t3404: "rebase -i" gets broken when insn sheet uses CR/LF line endings
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 28 Oct 2015 14:54:21 +0000 (15:54 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Oct 2015 17:01:59 +0000 (10:01 -0700)
Based on a bug report by Chad Boles.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3404-rebase-interactive.sh
index 88d7d5358ac37ce01c68a7e04f050e843acc1989..65474dc13aa1931757c6fae4721059f89c5655aa 100755 (executable)
@@ -1240,4 +1240,16 @@ test_expect_success 'static check of bad SHA-1' '
        test E = $(git cat-file commit HEAD | sed -ne \$p)
 '
 
+test_expect_failure 'editor saves as CR/LF' '
+       git checkout -b with-crlf &&
+       write_script add-crs.sh <<-\EOF &&
+       sed -e "s/\$/Q/" <"$1" | tr Q "\\015" >"$1".new &&
+       mv -f "$1".new "$1"
+       EOF
+       (
+               test_set_editor "$(pwd)/add-crs.sh" &&
+               git rebase -i HEAD^
+       )
+'
+
 test_done