git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] am: fix incorrect exit status on am fail to abort

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 8, 2021, 16:33 UTC
Message-ID
<xmqqwnnr3u3l.fsf@gitster.g>
In-Reply-To
<5fa7daf264b75fc5419e829683be2e6d83191908.1631067429.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Elijah Newren <newren@gmail.com>
>
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
Obviously correct.
Show 31 quoted lines
>  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 &&
Previous: Elijah Newren via GitGitGadgetNext: Johannes Schindelin
Message 9 of 15 in “A pair of git am --abort issues”
  1. 0/2 A pair of git am --abort issuesElijah Newren via GitGitGadget, Sep 8, 2021
  2. 1/2 t4151: document a pair of am --abort bugsElijah Newren via GitGitGadget, Sep 8, 2021
  3. Bagas SanjayaSep 8, 2021
  4. Elijah NewrenSep 8, 2021
  5. Junio C HamanoSep 8, 2021
  6. Elijah NewrenSep 8, 2021
  7. Junio C HamanoSep 8, 2021
  8. 2/2 am: fix incorrect exit status on am fail to abortElijah Newren via GitGitGadget, Sep 8, 2021
  9. Junio C HamanoSep 8, 2021
  10. Johannes SchindelinSep 8, 2021
  11. 0/3 A pair of git am --abort issuesElijah Newren via GitGitGadget, Sep 10, 2021
  12. 1/3 git-am.txt: clarify --abort behaviorElijah Newren via GitGitGadget, Sep 10, 2021
  13. 2/3 t4151: add a few am --abort testsElijah Newren via GitGitGadget, Sep 10, 2021
  14. 3/3 am: fix incorrect exit status on am fail to abortElijah Newren via GitGitGadget, Sep 10, 2021
  15. Johannes SchindelinSep 13, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.