Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] t9903: fix broken && chain
Date: Wed, 07 Sep 2016 11:35:44 -0700	[thread overview]
Message-ID: <xmqqbmzzmubj.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <61de943c-df93-58e9-ca48-c469a71a1d43@kdbg.org> (Johannes Sixt's message of "Mon, 5 Sep 2016 21:00:47 +0200")

Johannes Sixt <j6t@kdbg.org> writes:

> We might wonder why our && chain check does not catch this case:
> The && chain check uses a strange exit code with the expectation that
> the second or later part of a broken && chain would not exit with this
> particular code.
>
> This expectation does not work in this case because __git_ps1, being
> the first command in the second part of the broken && chain, records
> the current exit code, does its work, and finally returns to the caller
> with the recorded exit code. This fools our && chain check.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  t/t9903-bash-prompt.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
> index 0db4469..97c9b32 100755
> --- a/t/t9903-bash-prompt.sh
> +++ b/t/t9903-bash-prompt.sh
> @@ -177,7 +177,7 @@ test_expect_success 'prompt - interactive rebase' '
>  	git checkout b1 &&
>  	test_when_finished "git checkout master" &&
>  	git rebase -i HEAD^ &&
> -	test_when_finished "git rebase --abort"
> +	test_when_finished "git rebase --abort" &&
>  	__git_ps1 >"$actual" &&
>  	test_cmp expected "$actual"
>  '

Thanks.

      parent reply	other threads:[~2016-09-07 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 19:00 [PATCH] t9903: fix broken && chain Johannes Sixt
2016-09-06  7:15 ` Jeff King
2016-09-07 18:35 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqbmzzmubj.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox