blame: CRLF in the working tree and LF in the repo
[gitweb.git] / t / t8003-blame-corner-cases.sh
index e7cac1db55113188c7149686399292bded9c07dd..7ad66149c680a1ddb111d4b596652799186b4d38 100755 (executable)
@@ -191,4 +191,25 @@ test_expect_success 'indent of line numbers, ten lines' '
        test $(grep -c "  " actual) = 9
 '
 
+test_expect_success 'setup file with CRLF newlines' '
+       git config core.autocrlf false &&
+       printf "testcase\n" >crlffile &&
+       git add crlffile &&
+       git commit -m testcase &&
+       printf "testcase\r\n" >crlffile
+'
+
+test_expect_success 'blame file with CRLF core.autocrlf true' '
+       git config core.autocrlf true &&
+       git blame crlffile >actual &&
+       grep "A U Thor" actual
+'
+
+test_expect_success 'blame file with CRLF attributes text' '
+       git config core.autocrlf false &&
+       echo "crlffile text" >.gitattributes &&
+       git blame crlffile >actual &&
+       grep "A U Thor" actual
+'
+
 test_done