Skip to content

Commit

Permalink
rebase: create HEAD reflog entry when aborting
Browse files Browse the repository at this point in the history
When we abort a rebase, we return to the original value of
HEAD. Failing to write a reflog entry means we create a
gap in the reflog (which can cause "git show
HEAD@{5.minutes.ago}" to issue a warning). Plus having the
extra entry makes the reflog easier to follow for a human.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Csaba Henk authored and Junio C Hamano committed May 27, 2011
1 parent a9930e3 commit ea69619
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ abort)
read_basic_state
case "$head_name" in
refs/*)
git symbolic-ref HEAD $head_name ||
git symbolic-ref -m "rebase: aborting" HEAD $head_name ||
die "Could not move back to $head_name"
;;
esac
Expand Down

0 comments on commit ea69619

Please sign in to comment.