(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: {(SQ <'diff.*.textconv tests'>)} ) ] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: find_diff body: (command.BraceGroup children: [ (command.Pipeline children: [(C {(sed)} {(SQ <'1,/^index /d'>)}) (C {(sed)} {(SQ <'/^-- $/,$d'>)})] negated: F ) ] ) ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.binary)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(SQ <EOF>)} here_end_span_id: 49 stdin_parts: [('Binary files a/file and b/file differ\n')] ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.text)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 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')] ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(hexdump)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(SQ <EOF>)} here_end_span_id: 80 stdin_parts: [ ('#!/bin/sh\n') ('"$PERL_PATH" -e \'$/ = undef; $_ = <>; s/./ord($&)/ge; print $_\' < "$1"\n') ] ) ] ) (C {(chmod)} {(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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.stat)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 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') ] ) ] ) (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.SimpleCommand words: [{(echo)} {(file)} {(Lit_VarLike 'diff=') (foo)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(.gitattributes)})] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.typechange)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 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') ] ) ] ) (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)}) ] )