git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH 2/2] am: fix incorrect exit status on am fail to abort
Date: Wed, 08 Sep 2021 09:33:34 -0700	[thread overview]
Message-ID: <xmqqwnnr3u3l.fsf@gitster.g> (raw)
In-Reply-To: <5fa7daf264b75fc5419e829683be2e6d83191908.1631067429.git.gitgitgadget@gmail.com> (Elijah Newren via GitGitGadget's message of "Wed, 08 Sep 2021 02:17:09 +0000")

"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Elijah Newren <newren@gmail.com>
>
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---

Obviously correct.

>  builtin/am.c        | 3 ++-
>  t/t4151-am-abort.sh | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/am.c b/builtin/am.c
> index 0c2ad96b70e..c79e0167e98 100644
> --- a/builtin/am.c
> +++ b/builtin/am.c
> @@ -2106,7 +2106,8 @@ static void am_abort(struct am_state *state)
>  	if (!has_orig_head)
>  		oidcpy(&orig_head, the_hash_algo->empty_tree);
>  
> -	clean_index(&curr_head, &orig_head);
> +	if (clean_index(&curr_head, &orig_head))
> +		die(_("failed to clean index"));
>  
>  	if (has_orig_head)
>  		update_ref("am --abort", "HEAD", &orig_head,
> diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
> index 501a7a9d211..f889f25a98f 100755
> --- a/t/t4151-am-abort.sh
> +++ b/t/t4151-am-abort.sh
> @@ -195,7 +195,7 @@ test_expect_success 'am --abort leaves index stat info alone' '
>  	git diff-files --exit-code --quiet
>  '
>  
> -test_expect_failure 'git am --abort return failed exit status when it fails' '
> +test_expect_success 'git am --abort return failed exit status when it fails' '
>  	test_when_finished "rm -rf file-2/ && git reset --hard" &&
>  	git checkout changes &&
>  	git format-patch -1 --stdout conflicting >changes.mbox &&

  reply	other threads:[~2021-09-08 16:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08  2:17 [PATCH 0/2] A pair of git am --abort issues Elijah Newren via GitGitGadget
2021-09-08  2:17 ` [PATCH 1/2] t4151: document a pair of am --abort bugs Elijah Newren via GitGitGadget
2021-09-08  5:13   ` Bagas Sanjaya
2021-09-08  5:24     ` Elijah Newren
2021-09-08  7:02   ` Junio C Hamano
2021-09-08  8:00     ` Elijah Newren
2021-09-08 16:33       ` Junio C Hamano
2021-09-08  2:17 ` [PATCH 2/2] am: fix incorrect exit status on am fail to abort Elijah Newren via GitGitGadget
2021-09-08 16:33   ` Junio C Hamano [this message]
2021-09-08  8:08 ` [PATCH 0/2] A pair of git am --abort issues Johannes Schindelin
2021-09-10 10:31 ` [PATCH v2 0/3] " Elijah Newren via GitGitGadget
2021-09-10 10:31   ` [PATCH v2 1/3] git-am.txt: clarify --abort behavior Elijah Newren via GitGitGadget
2021-09-10 10:31   ` [PATCH v2 2/3] t4151: add a few am --abort tests Elijah Newren via GitGitGadget
2021-09-10 10:31   ` [PATCH v2 3/3] am: fix incorrect exit status on am fail to abort Elijah Newren via GitGitGadget
2021-09-13 12:08   ` [PATCH v2 0/3] A pair of git am --abort issues Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqwnnr3u3l.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).