Skip to content

Commit d5bc6f2

Browse files
dschogitster
authored andcommitted
rebase -i: demonstrate bugs with fixup!/squash! commit messages
When multiple fixup/squash commands are processed and the last one causes merge conflicts and is skipped, we leave the "This is a combination of ..." comments in the commit message. Noticed by Eric Sunshine. This regression test also demonstrates that we rely on the localized version of # This is a combination of <number> commits to contain the <number> in ASCII, which breaks under GETTEXT_POISON. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 468165c commit d5bc6f2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

t/t3418-rebase-continue.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ test_expect_success 'rebase passes merge strategy options correctly' '
8888
git rebase --continue
8989
'
9090

91+
test_expect_failure '--skip after failed fixup cleans commit message' '
92+
test_when_finished "test_might_fail git rebase --abort" &&
93+
git checkout -b with-conflicting-fixup &&
94+
test_commit wants-fixup &&
95+
test_commit "fixup! wants-fixup" wants-fixup.t 1 wants-fixup-1 &&
96+
test_commit "fixup! wants-fixup" wants-fixup.t 2 wants-fixup-2 &&
97+
test_commit "fixup! wants-fixup" wants-fixup.t 3 wants-fixup-3 &&
98+
test_must_fail env FAKE_LINES="1 fixup 2 fixup 4" \
99+
git rebase -i HEAD~4 &&
100+
101+
: now there is a conflict, and comments in the commit message &&
102+
git show HEAD >out &&
103+
grep "fixup! wants-fixup" out &&
104+
105+
: skip and continue &&
106+
git rebase --skip &&
107+
108+
: now the comments in the commit message should have been cleaned up &&
109+
git show HEAD >out &&
110+
! grep "fixup! wants-fixup" out
111+
'
112+
91113
test_expect_success 'setup rerere database' '
92114
rm -fr .git/rebase-* &&
93115
git reset --hard commit-new-file-F3-on-topic-branch &&

0 commit comments

Comments
 (0)