aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-26 11:24:29 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-26 23:06:38 -0800
commit2d56a136435bd40f9b6b75103eb4d75003154c9f (patch)
tree51f563269ab7b25b03ad1838eb2081404a315591
parentc767184d8f99404d456b32a2c6c5c41d6db7a847 (diff)
downloadgit-2d56a136435bd40f9b6b75103eb4d75003154c9f.tar.gz
git-2d56a136435bd40f9b6b75103eb4d75003154c9f.tar.xz
git-am: make --abort less dangerous
When you are in the middle of "git rebase", "git am --abort" by mistake would have referred to nonexistent ORIG_HEAD and barfed, or worse yet, used a stale ORIG_HEAD and taken you to an unexpected commit. Also the option parsing did not reject "git am --abort --skip". Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-am.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-am.sh b/git-am.sh
index 351b4f86f..d3390755f 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -221,6 +221,9 @@ then
resume=yes
case "$skip,$abort" in
+ t,t)
+ die "Please make up your mind. --skip or --abort?"
+ ;;
t,)
git rerere clear
git read-tree --reset -u HEAD HEAD
@@ -229,6 +232,10 @@ then
git update-ref ORIG_HEAD $orig_head
;;
,t)
+ if test -f "$dotest/rebasing"
+ then
+ exec git rebase --abort
+ fi
git rerere clear
test -f "$dotest/dirtyindex" || {
git read-tree --reset -u HEAD ORIG_HEAD