From 7b3b7e37581fb5266a260687c21af1571b4ade81 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 21 Dec 2010 10:35:53 -0800 Subject: am --abort: keep unrelated commits since the last failure and warn After making commits (either by pulling or doing their own work) after a failed "am", the user will be reminded by next "am" invocation that there was a failed "am" that the user needs to decide to resolve or to get rid of the old "am" attempt. The "am --abort" option was meant to help the latter. However, it rewinded the HEAD back to the beginning of the failed "am" attempt, discarding commits made (perhaps by mistake) since. Signed-off-by: Junio C Hamano --- t/t4151-am-abort.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 't/t4151-am-abort.sh') diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh index b55c411788..c95c4ccc39 100755 --- a/t/t4151-am-abort.sh +++ b/t/t4151-am-abort.sh @@ -62,4 +62,13 @@ do done +test_expect_success 'am --abort will keep the local commits intact' ' + test_must_fail git am 0004-*.patch && + test_commit unrelated && + git rev-parse HEAD >expect && + git am --abort && + git rev-parse HEAD >actual && + test_cmp expect actual +' + test_done -- cgit v1.2.3