1
0
mirror of https://github.com/git/git.git synced 2024-09-28 22:02:23 +02:00

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>
This commit is contained in:
Junio C Hamano 2009-02-26 11:24:29 -08:00
parent c767184d8f
commit 2d56a13643

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