(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'rewrite diff on binary file'>)} spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShFunction name: make_file body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple words: [{<printf>} {(DQ <'='> <Id.Lit_BadBackslash '\\'> <n>)}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<file>})] more_env: [] do_fork: T ) (command.ForEach iter_names: [i] iterable: (for_iter.Words words: [{<1>} {<2>} {<3>} {<4>} {<5>} {<6>} {<7>} {<8>} {<9>} {<10>}] ) body: (command.DoGroup children: [ (command.ForEach iter_names: [j] iterable: (for_iter.Words words: [{<1>} {<2>} {<3>} {<4>} {<5>} {<6>} {<7>} {<8>} {<9>}] ) body: (command.DoGroup children: [ (command.ForEach iter_names: [k] iterable: (for_iter.Words words:[{<1>} {<2>} {<3>} {<4>} {<5>}]) body: (command.DoGroup children: [ (C {<printf>} {(DQ ($ Id.VSub_Number 1) <Id.Lit_BadBackslash '\\'> <n>)} ) ] ) redirects: [] ) ] ) redirects: [] ) ] ) redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<file>})] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (C {<test_expect_success>} {(SQ <'create binary file with changes'>)} {(SQ <'\n'> <'\tmake_file "\\\\0" &&\n'> <'\tgit add file &&\n'> <'\tmake_file "\\\\01"\n'>)} ) (C {<test_expect_success>} {(SQ <'vanilla diff is binary'>)} { (SQ <'\n'> <'\tgit diff >diff &&\n'> <'\tgrep "Binary files a/file and b/file differ" diff\n'>) } ) (C {<test_expect_success>} {(SQ <'rewrite diff is binary'>)} { (SQ <'\n'> <'\tgit diff -B >diff &&\n'> <'\tgrep "dissimilarity index" diff &&\n'> <'\tgrep "Binary files a/file and b/file differ" diff\n'> ) } ) (C {<test_expect_success>} {(SQ <'rewrite diff can show binary patch'>)} { (SQ <'\n'> <'\tgit diff -B --binary >diff &&\n'> <'\tgrep "dissimilarity index" diff &&\n'> <'\tgrep "GIT binary patch" diff\n'> ) } ) (C {<test_expect_success>} {(SQ <'rewrite diff --numstat shows binary changes'>)} { (SQ <'\n'> <'\tgit diff -B --numstat --summary >diff &&\n'> <'\tgrep -e "-\t-\t" diff &&\n'> <'\tgrep " rewrite file" diff\n'> ) } ) (C {<test_expect_success>} {(SQ <'diff --stat counts binary rewrite as 0 lines'>)} { (SQ <'\n'> <'\tgit diff -B --stat --summary >diff &&\n'> <'\tgrep "Bin" diff &&\n'> <'\ttest_i18ngrep "0 insertions.*0 deletions" diff &&\n'> <'\tgrep " rewrite file" diff\n'> ) } ) (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (C {<echo>} {(DQ <'#!'> ($ Id.VSub_DollarName SHELL_PATH))}) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(SQ <EOF>)} here_end_span_id: 248 stdin_parts: [ <'"$PERL_PATH" -e \'$/ = undef; $_ = <>; s/./ord($&)/ge; print $_\' < "$1"\n'> ] ) ) ] more_env: [] do_fork: T ) ] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<dump>})] right: <Id.Lit_RBrace '}'> ) (C {<chmod>} {<Id.Lit_Other '+'> <x>} {<dump>}) (C {<test_expect_success>} {(SQ <'setup textconv'>)} { (SQ <'\n'> <'\techo file diff=foo >.gitattributes &&\n'> <'\tgit config diff.foo.textconv "\\"$(pwd)\\""/dump\n'> ) } ) (C {<test_expect_success>} {(SQ <'rewrite diff respects textconv'>)} { (SQ <'\n'> <'\tgit diff -B >diff &&\n'> <'\tgrep "dissimilarity index" diff &&\n'> <'\tgrep "^-61" diff &&\n'> <'\tgrep "^-0" diff\n'> ) } ) (C {<test_done>}) ] )