]> granicus.if.org Git - git/commitdiff
rebase: finish_rebase() in fast-forward rebase
authorRamkumar Ramachandra <artagnon@gmail.com>
Thu, 13 Jun 2013 16:06:12 +0000 (21:36 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Jun 2013 22:30:02 +0000 (15:30 -0700)
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>
git-rebase.sh
t/t3420-rebase-autostash.sh

index 2122fe030e55ac047c514822e0156911b54a05b0..154d4be0a44bf1bd66a7d01921cc9f46cd9d91e2 100755 (executable)
@@ -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
 
index 479cbb215fc90e5d5741fca830c62b8b4e8121e1..1bde00716046e5483b7121d31a455b41f82d8342 100755 (executable)
@@ -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