Re: [PATCH] t/t5534: do not unset GIT_COMMITTER_EMAIL for other tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 19, 2018 at 02:14:09PM +0200, Henning Schild wrote:
> Unsetting the varibale for good can have unwanted effects for new

s/varibale/variable

> tests added in the future It also meant we needed to hardcode the

s/future/&.

> value for "user.signingkey".
> Move the unset into a subshell, get rid of the hardcoded
> "committer@xxxxxxxxxxx", and switch the GPG variant to using test_config
> just like GPGSM.

OK, sounds good.

> Signed-off-by: Henning Schild <henning.schild@xxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxx &&
> -	test_must_fail git push --signed dst noop ff +noff &&
> -	git config user.signingkey committer@xxxxxxxxxxx &&
> +	test_config user.email hasnokey@xxxxxxxxxxx &&
> +	(
> +		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 &&

I think replacing the 'git config' invocations with their 'test_config'
equivalents in its own patch would be easier to grok, but I don't think
that splitting the change out is worth a re-roll on its own.

>  	(
> @@ -241,11 +243,14 @@ test_expect_success GPGSM 'fail without key and heed user.signingkey x509' '
>  	E_O_F
>
>  	EOF
> -	unset GIT_COMMITTER_EMAIL &&
> +

Nit; remove this newline.

>  	test_config user.email hasnokey@xxxxxxxxxxx &&
>  	test_config user.signingkey "" &&
> -	test_must_fail git push --signed dst noop ff +noff &&
> -	test_config user.signingkey committer@xxxxxxxxxxx &&
> +	(
> +		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 &&

Looks good.

>  	(
> --
> 2.16.4

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux