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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Apr 27, 2018 at 22:48 UTC
d5bc6f292ab0a1715ff021f5854ac5a81c2b88b0
1 file changed
+22
t/t3418-rebase-continue.sh
+22
@@ -88,6 +88,28 @@ test_expect_success 'rebase passes merge strategy options correctly' '
88
git rebase --continue
89
'
90
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
+
113
test_expect_success 'setup rerere database' '
114
rm -fr .git/rebase-* &&
115
git reset --hard commit-new-file-F3-on-topic-branch &&