Skip to content

Commit

Permalink
Merge branch 'jk/rebase-head-reflog'
Browse files Browse the repository at this point in the history
* jk/rebase-head-reflog:
  rebase: write a reflog entry when finishing
  rebase: create HEAD reflog entry when aborting
  • Loading branch information
Junio C Hamano committed May 31, 2011
2 parents 7953156 + 53f2ffa commit df873f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,9 @@ do_next () {
refs/*)
message="$GIT_REFLOG_ACTION: $head_name onto $shortonto" &&
git update-ref -m "$message" $head_name $newhead $orig_head &&
git symbolic-ref HEAD $head_name
git symbolic-ref \
-m "$GIT_REFLOG_ACTION: returning to $head_name" \
HEAD $head_name
;;
esac && {
test ! -f "$state_dir"/verbose ||
Expand Down
6 changes: 4 additions & 2 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ move_to_original_branch () {
message="rebase finished: $head_name onto $onto"
git update-ref -m "$message" \
$head_name $(git rev-parse HEAD) $orig_head &&
git symbolic-ref HEAD $head_name ||
git symbolic-ref \
-m "rebase finished: returning to $head_name" \
HEAD $head_name ||
die "Could not move back to $head_name"
;;
esac
Expand Down Expand Up @@ -332,7 +334,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
2 changes: 1 addition & 1 deletion t/t3404-rebase-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ test_expect_success '--continue tries to commit' '
'

test_expect_success 'verbose flag is heeded, even after --continue' '
git reset --hard HEAD@{1} &&
git reset --hard master@{1} &&
test_tick &&
test_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&
echo resolved > file1 &&
Expand Down

0 comments on commit df873f9

Please sign in to comment.