Re: [PATCH 4/5] send-email: fix regression in sendemail.identity parsing

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

 



Hi Ævar,

On Fri, 17 May 2019, Ævar Arnfjörð Bjarmason wrote:

> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
> index 61d484d1a6..890e2874c3 100755
> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -1228,6 +1228,61 @@ test_expect_success $PREREQ 'sendemail.to works' '
>  	grep "To: Somebody <somebody@xxxxxx>" stdout
>  '
>
> +test_expect_success $PREREQ 'setup sendemail.identity' '
> +	git config --replace-all sendemail.to "default@xxxxxxxxxxx" &&
> +	git config --replace-all sendemail.isp.to "isp@xxxxxxxxxxx" &&
> +	git config --replace-all sendemail.cloud.to "cloud@xxxxxxxxxxx"
> +'
> +
> +test_expect_success $PREREQ 'sendemail.identity: reads the correct identity config' '
> +	git -c sendemail.identity=cloud send-email \
> +		--dry-run \
> +		--from="nobody@xxxxxxxxxxx" \
> +		$patches >stdout &&
> +	grep "To: cloud@xxxxxxxxxxx" stdout
> +'
> +
> +test_expect_success $PREREQ 'sendemail.identity: identity overrides sendemail.identity' '
> +	git -c sendemail.identity=cloud send-email \
> +		--identity=isp \
> +		--dry-run \
> +		--from="nobody@xxxxxxxxxxx" \
> +		$patches >stdout &&
> +	grep "To: isp@xxxxxxxxxxx" stdout
> +'
> +
> +test_expect_success $PREREQ 'sendemail.identity: --no-identity clears previous identity' '
> +	git -c sendemail.identity=cloud send-email \
> +		--no-identity \
> +		--dry-run \
> +		--from="nobody@xxxxxxxxxxx" \
> +		$patches >stdout &&
> +	grep "To: default@xxxxxxxxxxx" stdout
> +'
> +
> +test_expect_success $PREREQ 'sendemail.identity: bool identity variable existance overrides' '
> +	git -c sendemail.identity=cloud \
> +		-c sendemail.xmailer=true \
> +		-c sendemail.cloud.xmailer=false \
> +		send-email \
> +		--dry-run \
> +		--from="nobody@xxxxxxxxxxx" \
> +		$patches >stdout &&
> +	grep "To: cloud@xxxxxxxxxxx" stdout &&
> +	! grep "X-Mailer" stdout
> +'
> +
> +test_expect_success $PREREQ 'sendemail.identity: bool variable fallback' '
> +	git -c sendemail.identity=cloud \
> +		-c sendemail.xmailer=false \
> +		send-email \
> +		--dry-run \
> +		--from="nobody@xxxxxxxxxxx" \
> +		$patches >stdout &&
> +	grep "To: cloud@xxxxxxxxxxx" stdout &&
> +	! grep "X-Mailer" stdout
> +'
> +

These test cases all diligently use the `$PREREQ` prerequisite, but...

>  test_expect_success $PREREQ '--no-to overrides sendemail.to' '
>  	git send-email \
>  		--dry-run \
> @@ -1785,6 +1840,15 @@ test_expect_success '--dump-aliases must be used alone' '
>  	test_must_fail git send-email --dump-aliases --to=janice@xxxxxxxxxxx -1 refs/heads/accounting
>  '
>
> +test_expect_success 'aliases and sendemail.identity' '
> +	test_must_fail git \
> +		-c sendemail.identity=cloud \
> +		-c sendemail.aliasesfile=default-aliases \
> +		-c sendemail.cloud.aliasesfile=cloud-aliases \
> +		send-email -1 2>stderr &&
> +	test_i18ngrep "cloud-aliases" stderr
> +'
> +

This one is missing it. That breaks the Windows job in our Azure Pipeline
where we leave out all of the Perl bits (to accelerate the tests somewhat).

Ciao,
Dscho

>  test_sendmail_aliases () {
>  	msg="$1" && shift &&
>  	expect="$@" &&
> --
> 2.21.0.1020.gf2820cf01a
>
>
>

[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