(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'CRLF conversion'>)} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShFunction name: has_cr body: (BraceGroup children: [ (command.Pipeline children: [ (command.Simple words: [{<tr>} {(SQ <'\\015'>)} {<Q>}] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_Number '$1'))} ) ] do_fork: T ) (command.Simple words: [{<grep>} {<Q>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] do_fork: T ) ] negated: F ) ] ) ) (C {<test_expect_success>} {<setup>} { (SQ <'\n'> <'\n'> <'\tgit config core.autocrlf false &&\n'> <'\n'> <'\techo "one text" > .gitattributes &&\n'> <'\n'> <'\tfor w in Hello world how are you; do echo $w; done >one &&\n'> <'\tfor w in I am very very fine thank you; do echo $w; done >two &&\n'> <'\tgit add . &&\n'> <'\n'> <'\tgit commit -m initial &&\n'> <'\n'> <'\tone=$(git rev-parse HEAD:one) &&\n'> <'\ttwo=$(git rev-parse HEAD:two) &&\n'> <'\n'> <'\techo happy.\n'> ) } ) (C {<test_expect_success>} {(SQ <'eol=lf puts LFs in normalized file'>)} { (SQ <'\n'> <'\n'> <'\trm -f .gitattributes tmp one two &&\n'> <'\tgit config core.eol lf &&\n'> <'\tgit read-tree --reset -u HEAD &&\n'> <'\n'> <'\t! has_cr one &&\n'> <'\t! has_cr two &&\n'> <'\tonediff=$(git diff one) &&\n'> <'\ttwodiff=$(git diff two) &&\n'> <'\ttest -z "$onediff" && test -z "$twodiff"\n'> ) } ) (C {<test_expect_success>} {(SQ <'eol=crlf puts CRLFs in normalized file'>)} { (SQ <'\n'> <'\n'> <'\trm -f .gitattributes tmp one two &&\n'> <'\tgit config core.eol crlf &&\n'> <'\tgit read-tree --reset -u HEAD &&\n'> <'\n'> <'\thas_cr one &&\n'> <'\t! has_cr two &&\n'> <'\tonediff=$(git diff one) &&\n'> <'\ttwodiff=$(git diff two) &&\n'> <'\ttest -z "$onediff" && test -z "$twodiff"\n'> ) } ) (C {<test_expect_success>} {(SQ <'autocrlf=true overrides eol=lf'>)} { (SQ <'\n'> <'\n'> <'\trm -f .gitattributes tmp one two &&\n'> <'\tgit config core.eol lf &&\n'> <'\tgit config core.autocrlf true &&\n'> <'\tgit read-tree --reset -u HEAD &&\n'> <'\n'> <'\thas_cr one &&\n'> <'\thas_cr two &&\n'> <'\tonediff=$(git diff one) &&\n'> <'\ttwodiff=$(git diff two) &&\n'> <'\ttest -z "$onediff" && test -z "$twodiff"\n'> ) } ) (C {<test_expect_success>} {(SQ <'autocrlf=true overrides unset eol'>)} { (SQ <'\n'> <'\n'> <'\trm -f .gitattributes tmp one two &&\n'> <'\tgit config --unset-all core.eol &&\n'> <'\tgit config core.autocrlf true &&\n'> <'\tgit read-tree --reset -u HEAD &&\n'> <'\n'> <'\thas_cr one &&\n'> <'\thas_cr two &&\n'> <'\tonediff=$(git diff one) &&\n'> <'\ttwodiff=$(git diff two) &&\n'> <'\ttest -z "$onediff" && test -z "$twodiff"\n'> ) } ) (C {<test_expect_success>} {<NATIVE_CRLF>} {(SQ <'eol native is crlf'>)} { (SQ <'\n'> <'\n'> <'\trm -rf native_eol && mkdir native_eol &&\n'> <'\t(\n'> <'\t\tcd native_eol &&\n'> <'\t\tprintf "*.txt text\\n" >.gitattributes &&\n'> <'\t\tprintf "one\\r\\ntwo\\r\\nthree\\r\\n" >filedos.txt &&\n'> <'\t\tprintf "one\\ntwo\\nthree\\n" >fileunix.txt &&\n'> <'\t\tgit init &&\n'> <'\t\tgit config core.autocrlf false &&\n'> <'\t\tgit config core.eol native &&\n'> <'\t\tgit add filedos.txt fileunix.txt &&\n'> <'\t\tgit commit -m "first" &&\n'> <'\t\trm file*.txt &&\n'> <'\t\tgit reset --hard HEAD &&\n'> <'\t\thas_cr filedos.txt &&\n'> <'\t\thas_cr fileunix.txt\n'> <'\t)\n'> ) } ) (C {<test_done>}) ] )