rebase: create HEAD reflog entry when aborting

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>
This commit is contained in:
Csaba Henk 2011-05-27 16:13:02 -04:00 committed by Junio C Hamano
parent a9930e359c
commit ea69619cd1

View file

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