File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ keep_empty=
84
84
test " $( git config --bool rebase.autosquash) " = " true" && autosquash=t
85
85
86
86
read_basic_state () {
87
+ test -f " $state_dir /head-name" &&
88
+ test -f " $state_dir /onto" &&
87
89
head_name=$( cat " $state_dir " /head-name) &&
88
90
onto=$( cat " $state_dir " /onto) &&
89
91
# We always write to orig-head, but interactive rebase used to write to
545
547
# Lazily switch to the target branch if needed...
546
548
test -z " $switch_to " || git checkout " $switch_to " --
547
549
say " $( eval_gettext " Current branch \$ branch_name is up to date." ) "
550
+ finish_rebase
548
551
exit 0
549
552
else
550
553
say " $( eval_gettext " Current branch \$ branch_name is up to date, rebase forced." ) "
@@ -577,6 +580,7 @@ if test "$mb" = "$orig_head"
577
580
then
578
581
say " $( eval_gettext " Fast-forwarded \$ branch_name to \$ onto_name." ) "
579
582
move_to_original_branch
583
+ finish_rebase
580
584
exit 0
581
585
fi
582
586
Original file line number Diff line number Diff line change @@ -141,6 +141,28 @@ testrebase() {
141
141
'
142
142
}
143
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
+ test_expect_success " rebase: noop rebase" '
156
+ test_config rebase.autostash true &&
157
+ git reset --hard &&
158
+ git checkout -b same-feature-branch feature-branch &&
159
+ test_when_finished git branch -D same-feature-branch &&
160
+ echo dirty >>file1 &&
161
+ git rebase feature-branch &&
162
+ grep dirty file1 &&
163
+ git checkout feature-branch
164
+ '
165
+
144
166
testrebase " " .git/rebase-apply
145
167
testrebase " --merge" .git/rebase-merge
146
168
testrebase " --interactive" .git/rebase-merge
You can’t perform that action at this time.
0 commit comments