From b096374f4a2cec0403378c1e9b4fb5fe37b517f4 Mon Sep 17 00:00:00 2001 From: Ian Ward Comfort Date: Tue, 8 Jun 2010 01:16:11 -0700 Subject: rebase -i: Abort cleanly if new base cannot be checked out Untracked content in the working tree may prevent rebase -i from checking out the new base onto which it wants to replay commits, if the new base commit includes files at those (now untracked) paths. Currently, rebase -i dies uncleanly in this situation, updating ORIG_HEAD and leaving a useless .git/rebase-merge directory, with which the user can do nothing useful except rebase --abort. Make rebase -i abort the procedure itself instead, as non-interactive rebase already does, and add a test for this behavior. Signed-off-by: Ian Ward Comfort Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git-rebase--interactive.sh') diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 436b7f5977..6b86abc64b 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -974,8 +974,9 @@ EOF test -d "$REWRITTEN" || test -n "$NEVER_FF" || skip_unnecessary_picks + output git checkout $ONTO || die_abort "could not detach HEAD" git update-ref ORIG_HEAD $HEAD - output git checkout $ONTO && do_rest + do_rest ;; esac shift -- cgit v1.2.3