aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-24 13:49:00 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-24 13:49:00 -0700
commit76689ab83b65636a01dd34ecfb9c1382aa6e959a (patch)
treea2ea05a87eb3cf47128e914e2bcd2467620de073 /git-am.sh
parent001d1160541a6dcfceb82a0a900478e315a129eb (diff)
parent61e0eb9de268cab90ea2563957b4c74c77e82b48 (diff)
downloadgit-76689ab83b65636a01dd34ecfb9c1382aa6e959a.tar.gz
git-76689ab83b65636a01dd34ecfb9c1382aa6e959a.tar.xz
Merge branch 'rr/am-quit-empty-then-abort-fix'
Recent "rebase --autostash" update made it impossible to recover with "git am --abort" from a repository where "git am" without mbox was run by mistake and then was killed with "^C". * rr/am-quit-empty-then-abort-fix: t/am: use test_path_is_missing() where appropriate am: handle stray $dotest directory
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/git-am.sh b/git-am.sh
index 1cf3d1dac..9f4450916 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -506,6 +506,23 @@ then
esac
rm -f "$dotest/dirtyindex"
else
+ # Possible stray $dotest directory in the independent-run
+ # case; in the --rebasing case, it is upto the caller
+ # (git-rebase--am) to take care of stray directories.
+ if test -d "$dotest" && test -z "$rebasing"
+ then
+ case "$skip,$resolved,$abort" in
+ ,,t)
+ rm -fr "$dotest"
+ exit 0
+ ;;
+ *)
+ die "$(eval_gettext "Stray \$dotest directory found.
+Use \"git am --abort\" to remove it.")"
+ ;;
+ esac
+ fi
+
# Make sure we are not given --skip, --resolved, nor --abort
test "$skip$resolved$abort" = "" ||
die "$(gettext "Resolve operation not in progress, we are not resuming.")"