Skip to content

Commit c5ead19

Browse files
newrengitster
authored andcommitted
am: fix incorrect exit status on am fail to abort
Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 42b5e09 commit c5ead19

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

builtin/am.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,8 @@ static void am_abort(struct am_state *state)
21062106
if (!has_orig_head)
21072107
oidcpy(&orig_head, the_hash_algo->empty_tree);
21082108

2109-
clean_index(&curr_head, &orig_head);
2109+
if (clean_index(&curr_head, &orig_head))
2110+
die(_("failed to clean index"));
21102111

21112112
if (has_orig_head)
21122113
update_ref("am --abort", "HEAD", &orig_head,

t/t4151-am-abort.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ test_expect_success 'am --abort leaves index stat info alone' '
197197
git diff-files --exit-code --quiet
198198
'
199199

200-
test_expect_failure 'git am --abort return failed exit status when it fails' '
200+
test_expect_success 'git am --abort return failed exit status when it fails' '
201201
test_when_finished "rm -rf file-2/ && git reset --hard && git am --abort" &&
202202
git checkout changes &&
203203
git format-patch -1 --stdout conflicting >changes.mbox &&

0 commit comments

Comments
 (0)