blame: CRLF in the working tree and LF in the repo
[gitweb.git] / t / t8003-blame-corner-cases.sh
index 2a3469bcbea39e832ab44280bb1223fc4ee20b61..7ad66149c680a1ddb111d4b596652799186b4d38 100755 (executable)
@@ -191,12 +191,24 @@ test_expect_success 'indent of line numbers, ten lines' '
        test $(grep -c "  " actual) = 9
 '
 
-test_expect_success 'blaming files with CRLF newlines' '
+test_expect_success 'setup file with CRLF newlines' '
        git config core.autocrlf false &&
-       printf "testcase\r\n" >crlffile &&
+       printf "testcase\n" >crlffile &&
        git add crlffile &&
        git commit -m testcase &&
-       git -c core.autocrlf=input blame crlffile >actual &&
+       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
 '