Skip to content

Commit ea69619

Browse files
csabahenkgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a9930e3 commit ea69619

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-rebase.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ abort)
332332
read_basic_state
333333
case "$head_name" in
334334
refs/*)
335-
git symbolic-ref HEAD $head_name ||
335+
git symbolic-ref -m "rebase: aborting" HEAD $head_name ||
336336
die "Could not move back to $head_name"
337337
;;
338338
esac

0 commit comments

Comments
 (0)