Skip to contentSkip to conversation

t3404: test autosquash for fixup! commits with funny messages

PATCH/RFC Uwe Storbeck 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

This commit adds a test to verify the correct behavior when rebase -i is used to autosquash fixup! commits where the commit message contains a backslash sequence (\n).

When echo is used instead of printf to handle such a commit message the test will fail on shells (e.g. dash) where the echo command interprets backslash sequences as control characters.

---
 t/t3404-rebase-interactive.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
t/t3404-rebase-interactive.sh +12 -0
index 50e22b1..6d32661 100755
@@ -798,6 +798,18 @@ test_expect_success 'rebase-i history with funny messages' '
 	test_cmp expect actual
 '
 
+test_expect_success 'autosquash fixup! commits with funny messages' '
+	test_when_finished "git rebase --abort || :" &&
+	echo >>file1 &&
+	git commit -a -m "something that looks like a newline (\n)" &&
+	echo >>file1 &&
+	git commit -a --fixup HEAD &&
+	set_fake_editor &&
+	FAKE_LINES="" &&
+	export FAKE_LINES &&
+	git rebase -i --autosquash HEAD~2
+'
+
 
 test_expect_success 'prepare for rebase -i --exec' '
 	git checkout master &&
Signature · 1 line
1.9.0