(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"rewrite diff on binary file">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: make_file body: (BraceGroup children: [ (SimpleCommand words: [{(printf)} {(DQ ("=") (EscapedLiteralPart token:<Lit_EscapedChar "\\n">))}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(file)} spids:[39])] ) (ForEach iter_name: i iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)} {(10)}] do_arg_iter: False body: (DoGroup children: [ (ForEach iter_name: j iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)}] do_arg_iter: False body: (DoGroup children: [ (ForEach iter_name: k iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)}] do_arg_iter: False body: (DoGroup children: [ (C {(printf)} { (DQ ($ VSub_Number "$1") (EscapedLiteralPart token: <Lit_EscapedChar "\\n"> ) ) } ) ] spids: [118 129] ) spids: [106 -1] ) ] spids: [98 132] ) spids: [78 -1] ) ] spids: [70 135] ) redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(file)} spids:[137])] spids: [48 -1] ) ] spids: [25] ) spids: [21 24] ) (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 children: [ (C {(echo)} {(DQ ("#!") ($ VSub_Name "$SHELL_PATH"))}) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("\"$PERL_PATH\" -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < \"$1\"\n")} do_expansion: False here_end: EOF was_filled: True spids: [240] ) ] ) ] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(dump)} spids:[247])] spids: [227] ) (C {(chmod)} {(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)}) ] )