(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'diff.*.textconv tests'>)} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShFunction name: find_diff body: (BraceGroup children: [ (command.Pipeline children: [(C {<sed>} {(SQ <'1,/^index /d'>)}) (C {<sed>} {(SQ <'/^-- $/,$d'>)})] negated: F ) ] ) ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect.binary>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(SQ <EOF>)} here_end_span_id: 49 stdin_parts: [<'Binary files a/file and b/file differ\n'>] ) ) ] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect.text>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(SQ <EOF>)} here_end_span_id: 66 stdin_parts: [<'--- a/file\n'> <'+++ b/file\n'> <'@@ -1 +1,2 @@\n'> <' 0\n'> <'+1\n'>] ) ) ] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<hexdump>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(SQ <EOF>)} here_end_span_id: 80 stdin_parts: [ <'#!/bin/sh\n'> <'"$PERL_PATH" -e \'$/ = undef; $_ = <>; s/./ord($&)/ge; print $_\' < "$1"\n'> ] ) ) ] do_fork: T ) (C {<chmod>} {<Id.Lit_Other '+'> <x>} {<hexdump>}) (C {<test_expect_success>} {(SQ <'setup binary file with history'>)} { (SQ <'\n'> <'\tprintf "\\\\0\\\\n" >file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -m one &&\n'> <'\tprintf "\\\\01\\\\n" >>file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -m two\n'> ) } ) (C {<test_expect_success>} {(SQ <'file is considered binary by porcelain'>)} { (SQ <'\n'> <'\tgit diff HEAD^ HEAD >diff &&\n'> <'\tfind_diff <diff >actual &&\n'> <'\ttest_cmp expect.binary actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'file is considered binary by plumbing'>)} { (SQ <'\n'> <'\tgit diff-tree -p HEAD^ HEAD >diff &&\n'> <'\tfind_diff <diff >actual &&\n'> <'\ttest_cmp expect.binary actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'setup textconv filters'>)} { (SQ <'\n'> <'\techo file diff=foo >.gitattributes &&\n'> <'\tgit config diff.foo.textconv "\\"$(pwd)\\""/hexdump &&\n'> <'\tgit config diff.fail.textconv false\n'> ) } ) (C {<test_expect_success>} {(SQ <'diff produces text'>)} { (SQ <'\n'> <'\tgit diff HEAD^ HEAD >diff &&\n'> <'\tfind_diff <diff >actual &&\n'> <'\ttest_cmp expect.text actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'show commit produces text'>)} { (SQ <'\n'> <'\tgit show HEAD >diff &&\n'> <'\tfind_diff <diff >actual &&\n'> <'\ttest_cmp expect.text actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'diff-tree produces binary'>)} { (SQ <'\n'> <'\tgit diff-tree -p HEAD^ HEAD >diff &&\n'> <'\tfind_diff <diff >actual &&\n'> <'\ttest_cmp expect.binary actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'log produces text'>)} { (SQ <'\n'> <'\tgit log -1 -p >log &&\n'> <'\tfind_diff <log >actual &&\n'> <'\ttest_cmp expect.text actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'format-patch produces binary'>)} { (SQ <'\n'> <'\tgit format-patch --no-binary --stdout HEAD^ >patch &&\n'> <'\tfind_diff <patch >actual &&\n'> <'\ttest_cmp expect.binary actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'status -v produces text'>)} { (SQ <'\n'> <'\tgit reset --soft HEAD^ &&\n'> <'\tgit status -v >diff &&\n'> <'\tfind_diff <diff >actual &&\n'> <'\ttest_cmp expect.text actual &&\n'> <'\tgit reset --soft HEAD@{1}\n'> ) } ) (C {<test_expect_success>} {(SQ <'show blob produces binary'>)} { (SQ <'\n'> <'\tgit show HEAD:file >actual &&\n'> <'\tprintf "\\\\0\\\\n\\\\01\\\\n" >expect &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'show --textconv blob produces text'>)} { (SQ <'\n'> <'\tgit show --textconv HEAD:file >actual &&\n'> <'\tprintf "0\\\\n1\\\\n" >expect &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'show --no-textconv blob produces binary'>)} { (SQ <'\n'> <'\tgit show --no-textconv HEAD:file >actual &&\n'> <'\tprintf "\\\\0\\\\n\\\\01\\\\n" >expect &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'grep-diff (-G) operates on textconv data (add)'>)} { (SQ <'\n'> <'\techo one >expect &&\n'> <'\tgit log --root --format=%s -G0 >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'grep-diff (-G) operates on textconv data (modification)'>)} { (SQ <'\n'> <'\techo two >expect &&\n'> <'\tgit log --root --format=%s -G1 >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'pickaxe (-S) operates on textconv data (add)'>)} { (SQ <'\n'> <'\techo one >expect &&\n'> <'\tgit log --root --format=%s -S0 >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'pickaxe (-S) operates on textconv data (modification)'>)} { (SQ <'\n'> <'\techo two >expect &&\n'> <'\tgit log --root --format=%s -S1 >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect.stat>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(SQ <EOF>)} here_end_span_id: 344 stdin_parts: [ <' file | Bin 2 -> 4 bytes\n'> <' 1 file changed, 0 insertions(+), 0 deletions(-)\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'diffstat does not run textconv'>)} { (SQ <'\n'> <'\techo file diff=fail >.gitattributes &&\n'> <'\tgit diff --stat HEAD^ HEAD >actual &&\n'> <'\ttest_i18ncmp expect.stat actual &&\n'> <'\n'> <'\thead -n1 <expect.stat >expect.line1 &&\n'> <'\thead -n1 <actual >actual.line1 &&\n'> <'\ttest_cmp expect.line1 actual.line1\n'> ) } ) (command.Simple words: [{<echo>} {<file>} {<Id.Lit_VarLike 'diff='> <foo>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<.gitattributes>})] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect.typechange>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(SQ <EOF>)} here_end_span_id: 399 stdin_parts: [ <'--- a/file\n'> <'+++ /dev/null\n'> <'@@ -1,2 +0,0 @@\n'> <'-0\n'> <'-1\n'> <'diff --git a/file b/file\n'> <'new file mode 120000\n'> <'index 0000000..67be421\n'> <'--- /dev/null\n'> <'+++ b/file\n'> <'@@ -0,0 +1 @@\n'> <'+frotz\n'> <'\\ No newline at end of file\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'textconv does not act on symlinks'>)} { (SQ <'\n'> <'\trm -f file &&\n'> <'\ttest_ln_s_add frotz file &&\n'> <'\tgit commit -m typechange &&\n'> <'\tgit show >diff &&\n'> <'\tfind_diff <diff >actual &&\n'> <'\ttest_cmp expect.typechange actual\n'> ) } ) (C {<test_done>}) ] )