Skip to content

Commit

Permalink
rebase: finish_rebase() in fast-forward rebase
Browse files Browse the repository at this point in the history
In the following case

  $ git rebase master
  Fast-forwarded autostash-fix to master.

The autostash is not applied automatically, because this codepath
forgets to call finish_rebase().  Fix this.  Also add a test to guard
against regressions.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed Jun 13, 2013
1 parent dc8ca91 commit af2f0eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ if test "$mb" = "$orig_head"
then
say "$(eval_gettext "Fast-forwarded \$branch_name to \$onto_name.")"
move_to_original_branch
finish_rebase
exit 0
fi

Expand Down
11 changes: 11 additions & 0 deletions t/t3420-rebase-autostash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ testrebase() {
'
}

test_expect_success "rebase: fast-forward rebase" '
test_config rebase.autostash true &&
git reset --hard &&
git checkout -b behind-feature-branch feature-branch~1 &&
test_when_finished git branch -D behind-feature-branch &&
echo dirty >>file1 &&
git rebase feature-branch &&
grep dirty file1 &&
git checkout feature-branch
'

testrebase "" .git/rebase-apply
testrebase " --merge" .git/rebase-merge
testrebase " --interactive" .git/rebase-merge
Expand Down

0 comments on commit af2f0eb

Please sign in to comment.