From: Henning Schild Date: Thu, 19 Jul 2018 12:15:45 GMT Subject: Re: [PATCH] t/t5534: do not unset GIT_COMMITTER_EMAIL for other tests Message-ID: <20180719141545.48358a26@md1pvb1c.ad001.siemens.net> In-Reply-To: <20180719121409.6143-1-henning.schild@siemens.com> Looking at "what is cooking" i assume i should not add/fold this to/in the serien anymore. So it comes as a separate patch on top. Henning Am Thu, 19 Jul 2018 14:14:09 +0200 schrieb Henning Schild : > Unsetting the varibale for good can have unwanted effects for new > tests added in the future It also meant we needed to hardcode the > value for "user.signingkey". > Move the unset into a subshell, get rid of the hardcoded > "committer@example.com", and switch the GPG variant to using > test_config just like GPGSM. > > Signed-off-by: Henning Schild > --- > t/t5534-push-signed.sh | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh > index 0cb88aa6f..f6d674156 100755 > --- a/t/t5534-push-signed.sh > +++ b/t/t5534-push-signed.sh > @@ -194,10 +194,12 @@ test_expect_success GPG 'fail without key and > heed user.signingkey' ' > EOF > > - unset GIT_COMMITTER_EMAIL && > - git config user.email hasnokey@nowhere.com && > - test_must_fail git push --signed dst noop ff +noff && > - git config user.signingkey committer@example.com && > + test_config user.email hasnokey@nowhere.com && > + ( > + unset GIT_COMMITTER_EMAIL && > + test_must_fail git push --signed dst noop ff +noff > + ) && > + test_config user.signingkey $GIT_COMMITTER_EMAIL && > git push --signed dst noop ff +noff && > > ( > @@ -241,11 +243,14 @@ test_expect_success GPGSM 'fail without key and > heed user.signingkey x509' ' E_O_F > > EOF > - unset GIT_COMMITTER_EMAIL && > + > test_config user.email hasnokey@nowhere.com && > test_config user.signingkey "" && > - test_must_fail git push --signed dst noop ff +noff && > - test_config user.signingkey committer@example.com && > + ( > + unset GIT_COMMITTER_EMAIL && > + test_must_fail git push --signed dst noop ff +noff > + ) && > + test_config user.signingkey $GIT_COMMITTER_EMAIL && > git push --signed dst noop ff +noff && > > (