3 test_description
='CRLF renormalization'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
9 git config core.autocrlf false &&
10 printf "LINEONE\nLINETWO\nLINETHREE\n" >LF.txt &&
11 printf "LINEONE\r\nLINETWO\r\nLINETHREE\r\n" >CRLF.txt &&
12 printf "LINEONE\r\nLINETWO\nLINETHREE\n" >CRLF_mix_LF.txt &&
17 test_expect_success
'renormalize CRLF in repo' '
18 echo "*.txt text=auto" >.gitattributes &&
19 git add --renormalize "*.txt" &&
20 cat >expect <<-\EOF &&
21 i/lf w/crlf attr/text=auto CRLF.txt
22 i/lf w/lf attr/text=auto LF.txt
23 i/lf w/mixed attr/text=auto CRLF_mix_LF.txt
26 sed -e "s/ / /g" -e "s/ */ /g" |
28 test_cmp expect actual
31 test_expect_success
'ignore-errors not mistaken for renormalize' '
33 echo "*.txt text=auto" >.gitattributes &&
34 git ls-files --eol >expect &&
35 git add --ignore-errors "*.txt" &&
36 git ls-files --eol >actual &&
37 test_cmp expect actual