Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH] git-am: make --abort less dangerous

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:17
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---

 * An independent fix but textually depends on your patch.

 git-am.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 351b4f8..d339075 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help