rebase: finish_rebase() in fast-forward rebase
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>
Ramkumar Ramachandra committed
Jun 13, 2013 at 21:36 UTC
af2f0ebcbdb164043d6ad72c81c6ce5cdadf63b5
2 files changed
+12
git-rebase.sh
+1
@@ -579,6 +579,7 @@ if test "$mb" = "$orig_head"
579
then
580
say "$(eval_gettext "Fast-forwarded \$branch_name to \$onto_name.")"
581
move_to_original_branch
582
+ finish_rebase
583
exit 0
584
fi
585
t/t3420-rebase-autostash.sh
+11
@@ -141,6 +141,17 @@ testrebase() {
141
'
142
}
143
144
+test_expect_success "rebase: fast-forward rebase" '
145
+ test_config rebase.autostash true &&
146
+ git reset --hard &&
147
+ git checkout -b behind-feature-branch feature-branch~1 &&
148
+ test_when_finished git branch -D behind-feature-branch &&
149
+ echo dirty >>file1 &&
150
+ git rebase feature-branch &&
151
+ grep dirty file1 &&
152
+ git checkout feature-branch
153
+'
154
+
155
testrebase "" .git/rebase-apply
156
testrebase " --merge" .git/rebase-merge
157
testrebase " --interactive" .git/rebase-merge