(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: { (SQ <'CRLF merge conflict across text=auto change\n'> <'\n'> <'* [master] remove .gitattributes\n'> <' ! [side] add line from b\n'> <'--\n'> <' + [side] add line from b\n'> <'* [master] remove .gitattributes\n'> <'* [master^] add line from a\n'> <'* [master~2] normalize file\n'> <'*+ [side^] Initial\n'> ) } spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (AndOr children: [ (C {(test_have_prereq)} {(SED_STRIPS_CR)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:SED_OPTIONS) op:Equal rhs:{(-b)} spids:[30])] spids: [30] ) ] op_id: Op_DAmp ) (FuncDef name: compare_files body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [{(tr)} {(SQ <'\\015\\000'>)} {(QN)}] redirects: [ (Redir op_id: Redir_Less fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1'))} spids: [50] ) (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1')) (.expect)} spids: [55] ) ] ) (AndOr children: [ (SimpleCommand words: [{(tr)} {(SQ <'\\015\\000'>)} {(QN)}] redirects: [ (Redir op_id: Redir_Less fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} spids: [72] ) (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2')) (.actual)} spids: [77] ) ] ) (AndOr children: [ (C {(test_cmp)} {(DQ ($ VSub_Number '$1')) (.expect)} {(DQ ($ VSub_Number '$2')) (.actual)} ) (C {(rm)} {(DQ ($ VSub_Number '$1')) (.expect)} {(DQ ($ VSub_Number '$2')) (.actual)} ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [39] ) spids: [34 38] ) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\tgit config core.autocrlf false &&\n'> <'\n'> <'\techo first line | append_cr >file &&\n'> <'\techo first line >control_file &&\n'> <'\techo only line >inert_file &&\n'> <'\n'> <'\tgit add file control_file inert_file &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "Initial" &&\n'> <'\tgit tag initial &&\n'> <'\tgit branch side &&\n'> <'\n'> <'\techo "* text=auto" >.gitattributes &&\n'> <'\techo first line >file &&\n'> <'\tgit add .gitattributes file &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "normalize file" &&\n'> <'\n'> <'\techo same line | append_cr >>file &&\n'> <'\techo same line >>control_file &&\n'> <'\tgit add file control_file &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "add line from a" &&\n'> <'\tgit tag a &&\n'> <'\n'> <'\tgit rm .gitattributes &&\n'> <'\trm file &&\n'> <'\tgit checkout file &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "remove .gitattributes" &&\n'> <'\tgit tag c &&\n'> <'\n'> <'\tgit checkout side &&\n'> <'\techo same line | append_cr >>file &&\n'> <'\techo same line >>control_file &&\n'> <'\tgit add file control_file &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "add line from b" &&\n'> <'\tgit tag b &&\n'> <'\n'> <'\tgit checkout master\n'> ) } ) (C {(test_expect_success)} {(SQ <'set up fuzz_conflict() helper'>)} { (SQ <'\n'> <'\tfuzz_conflict() {\n'> <'\t\tsed $SED_OPTIONS -e "s/^\\([<>=]......\\) .*/\\1/" "$@"\n'> <'\t}\n'> ) } ) (C {(test_expect_success)} {(SQ <'Merge after setting text=auto'>)} { (SQ <'\n'> <'\tcat <<-\\EOF >expected &&\n'> <'\tfirst line\n'> <'\tsame line\n'> <'\tEOF\n'> <'\n'> <'\tif test_have_prereq NATIVE_CRLF; then\n'> <'\t\tappend_cr <expected >expected.temp &&\n'> <'\t\tmv expected.temp expected\n'> <'\tfi &&\n'> <'\tgit config merge.renormalize true &&\n'> <'\tgit rm -fr . &&\n'> <'\trm -f .gitattributes &&\n'> <'\tgit reset --hard a &&\n'> <'\tgit merge b &&\n'> <'\tcompare_files expected file\n'> ) } ) (C {(test_expect_success)} {(SQ <'Merge addition of text=auto eol=LF'>)} { (SQ <'\n'> <'\tgit config core.eol lf &&\n'> <'\tcat <<-\\EOF >expected &&\n'> <'\tfirst line\n'> <'\tsame line\n'> <'\tEOF\n'> <'\n'> <'\tgit config merge.renormalize true &&\n'> <'\tgit rm -fr . &&\n'> <'\trm -f .gitattributes &&\n'> <'\tgit reset --hard b &&\n'> <'\tgit merge a &&\n'> <'\tcompare_files expected file\n'> ) } ) (C {(test_expect_success)} {(SQ <'Merge addition of text=auto eol=CRLF'>)} { (SQ <'\n'> <'\tgit config core.eol crlf &&\n'> <'\tcat <<-\\EOF >expected &&\n'> <'\tfirst line\n'> <'\tsame line\n'> <'\tEOF\n'> <'\n'> <'\tappend_cr <expected >expected.temp &&\n'> <'\tmv expected.temp expected &&\n'> <'\tgit config merge.renormalize true &&\n'> <'\tgit rm -fr . &&\n'> <'\trm -f .gitattributes &&\n'> <'\tgit reset --hard b &&\n'> <'\techo >&2 "After git reset --hard b" &&\n'> <'\tgit ls-files -s --eol >&2 &&\n'> <'\tgit merge a &&\n'> <'\tcompare_files expected file\n'> ) } ) (C {(test_expect_success)} {(SQ <'Detect CRLF/LF conflict after setting text=auto'>)} { (SQ <'\n'> <'\tgit config core.eol native &&\n'> <'\techo "<<<<<<<" >expected &&\n'> <'\techo first line >>expected &&\n'> <'\techo same line >>expected &&\n'> <'\techo ======= >>expected &&\n'> <'\techo first line | append_cr >>expected &&\n'> <'\techo same line | append_cr >>expected &&\n'> <'\techo ">>>>>>>" >>expected &&\n'> <'\tgit config merge.renormalize false &&\n'> <'\trm -f .gitattributes &&\n'> <'\tgit reset --hard a &&\n'> <'\ttest_must_fail git merge b &&\n'> <'\tfuzz_conflict file >file.fuzzy &&\n'> <'\tcompare_files expected file.fuzzy\n'> ) } ) (C {(test_expect_success)} {(SQ <'Detect LF/CRLF conflict from addition of text=auto'>)} { (SQ <'\n'> <'\techo "<<<<<<<" >expected &&\n'> <'\techo first line | append_cr >>expected &&\n'> <'\techo same line | append_cr >>expected &&\n'> <'\techo ======= >>expected &&\n'> <'\techo first line >>expected &&\n'> <'\techo same line >>expected &&\n'> <'\techo ">>>>>>>" >>expected &&\n'> <'\tgit config merge.renormalize false &&\n'> <'\trm -f .gitattributes &&\n'> <'\tgit reset --hard b &&\n'> <'\ttest_must_fail git merge a &&\n'> <'\tfuzz_conflict file >file.fuzzy &&\n'> <'\tcompare_files expected file.fuzzy\n'> ) } ) (C {(test_expect_failure)} {(SQ <'checkout -m after setting text=auto'>)} { (SQ <'\n'> <'\tcat <<-\\EOF >expected &&\n'> <'\tfirst line\n'> <'\tsame line\n'> <'\tEOF\n'> <'\n'> <'\tgit config merge.renormalize true &&\n'> <'\tgit rm -fr . &&\n'> <'\trm -f .gitattributes &&\n'> <'\tgit reset --hard initial &&\n'> <'\tgit checkout a -- . &&\n'> <'\tgit checkout -m b &&\n'> <'\tcompare_files expected file\n'> ) } ) (C {(test_expect_failure)} {(SQ <'checkout -m addition of text=auto'>)} { (SQ <'\n'> <'\tcat <<-\\EOF >expected &&\n'> <'\tfirst line\n'> <'\tsame line\n'> <'\tEOF\n'> <'\n'> <'\tgit config merge.renormalize true &&\n'> <'\tgit rm -fr . &&\n'> <'\trm -f .gitattributes file &&\n'> <'\tgit reset --hard initial &&\n'> <'\tgit checkout b -- . &&\n'> <'\tgit checkout -m a &&\n'> <'\tcompare_files expected file\n'> ) } ) (C {(test_expect_failure)} {(SQ <'cherry-pick patch from after text=auto was added'>)} { (SQ <'\n'> <'\tappend_cr <<-\\EOF >expected &&\n'> <'\tfirst line\n'> <'\tsame line\n'> <'\tEOF\n'> <'\n'> <'\tgit config merge.renormalize true &&\n'> <'\tgit rm -fr . &&\n'> <'\tgit reset --hard b &&\n'> <'\ttest_must_fail git cherry-pick a >err 2>&1 &&\n'> <'\tgrep "[Nn]othing added" err &&\n'> <'\tcompare_files expected file\n'> ) } ) (C {(test_expect_success)} {(SQ <'Test delete/normalize conflict'>)} { (SQ <'\n'> <'\tgit checkout -f side &&\n'> <'\tgit rm -fr . &&\n'> <'\trm -f .gitattributes &&\n'> <'\tgit reset --hard initial &&\n'> <'\tgit rm file &&\n'> <'\tgit commit -m "remove file" &&\n'> <'\tgit checkout master &&\n'> <'\tgit reset --hard a^ &&\n'> <'\tgit merge side\n'> ) } ) (C {(test_done)}) ] )