(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'git grep in binary files'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <setup>)} { (DQ ('\n') ("\techo 'binaryQfile' | q_to_nul >a &&\n") ('\tgit add a &&\n') ('\tgit commit -m.\n') ) } ) (C {(test_expect_success)} {(SQ <'git grep ina a'>)} { (SQ <'\n'> <'\techo Binary file a matches >expect &&\n'> <'\tgit grep ina a >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'git grep -ah ina a'>)} {(SQ <'\n'> <'\tgit grep -ah ina a >actual &&\n'> <'\ttest_cmp a actual\n'>)} ) (C {(test_expect_success)} {(SQ <'git grep -I ina a'>)} { (SQ <'\n'> <'\t: >expect &&\n'> <'\ttest_must_fail git grep -I ina a >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'git grep -c ina a'>)} { (SQ <'\n'> <'\techo a:1 >expect &&\n'> <'\tgit grep -c ina a >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'git grep -l ina a'>)} { (SQ <'\n'> <'\techo a >expect &&\n'> <'\tgit grep -l ina a >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'git grep -L bar a'>)} { (SQ <'\n'> <'\techo a >expect &&\n'> <'\tgit grep -L bar a >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'git grep -q ina a'>)} { (SQ <'\n'> <'\t: >expect &&\n'> <'\tgit grep -q ina a >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'git grep -F ile a'>)} {(SQ <'\n'> <'\tgit grep -F ile a\n'>)}) (C {(test_expect_success)} {(SQ <'git grep -Fi iLE a'>)} {(SQ <'\n'> <'\tgit grep -Fi iLE a\n'>)}) (C {(test_expect_success)} {(SQ <'git grep ile a'>)} {(SQ <'\n'> <'\tgit grep ile a\n'>)}) (C {(test_expect_failure)} {(SQ <'git grep .fi a'>)} {(SQ <'\n'> <'\tgit grep .fi a\n'>)}) (C {(test_expect_success)} {(SQ <'git grep -F y<NUL>f a'>)} {(DQ ('\n') ("\tprintf 'yQf' | q_to_nul >f &&\n") ('\tgit grep -f f -F a\n'))} ) (C {(test_expect_success)} {(SQ <'git grep -F y<NUL>x a'>)} {(DQ ('\n') ("\tprintf 'yQx' | q_to_nul >f &&\n") ('\ttest_must_fail git grep -f f -F a\n'))} ) (C {(test_expect_success)} {(SQ <'git grep -Fi Y<NUL>f a'>)} {(DQ ('\n') ("\tprintf 'YQf' | q_to_nul >f &&\n") ('\tgit grep -f f -Fi a\n'))} ) (C {(test_expect_success)} {(SQ <'git grep -Fi Y<NUL>x a'>)} {(DQ ('\n') ("\tprintf 'YQx' | q_to_nul >f &&\n") ('\ttest_must_fail git grep -f f -Fi a\n'))} ) (C {(test_expect_success)} {(SQ <'git grep y<NUL>f a'>)} {(DQ ('\n') ("\tprintf 'yQf' | q_to_nul >f &&\n") ('\tgit grep -f f a\n'))} ) (C {(test_expect_success)} {(SQ <'git grep y<NUL>x a'>)} {(DQ ('\n') ("\tprintf 'yQx' | q_to_nul >f &&\n") ('\ttest_must_fail git grep -f f a\n'))} ) (C {(test_expect_success)} {(SQ <'grep respects binary diff attribute'>)} { (SQ <'\n'> <'\techo text >t &&\n'> <'\tgit add t &&\n'> <'\techo t:text >expect &&\n'> <'\tgit grep text t >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\techo "t -diff" >.gitattributes &&\n'> <'\techo "Binary file t matches" >expect &&\n'> <'\tgit grep text t >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'grep --cached respects binary diff attribute'>)} {(SQ <'\n'> <'\tgit grep --cached text t >actual &&\n'> <'\ttest_cmp expect actual\n'>)} ) (C {(test_expect_success)} {(SQ <'grep --cached respects binary diff attribute (2)'>)} { (SQ <'\n'> <'\tgit add .gitattributes &&\n'> <'\trm .gitattributes &&\n'> <'\tgit grep --cached text t >actual &&\n'> <'\ttest_when_finished "git rm --cached .gitattributes" &&\n'> <'\ttest_when_finished "git checkout .gitattributes" &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'grep revision respects binary diff attribute'>)} { (SQ <'\n'> <'\tgit commit -m new &&\n'> <'\techo "Binary file HEAD:t matches" >expect &&\n'> <'\tgit grep text HEAD -- t >actual &&\n'> <'\ttest_when_finished "git reset HEAD^" &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'grep respects not-binary diff attribute'>)} { (SQ <'\n'> <'\techo binQary | q_to_nul >b &&\n'> <'\tgit add b &&\n'> <'\techo "Binary file b matches" >expect &&\n'> <'\tgit grep bin b >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\techo "b diff" >.gitattributes &&\n'> <'\techo "b:binQary" >expect &&\n'> <'\tgit grep bin b >actual.raw &&\n'> <'\tnul_to_q <actual.raw >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:16777215 arg_word:{(nul_to_q_textconv)} spids:[347]) (HereDoc op_id: Redir_DLess fd: 16777215 body: {('#!/bin/sh\n') ('"$PERL_PATH" -pe \'y/\\000/Q/\' < "$1"\n')} do_expansion: False here_end: EOF was_filled: True spids: [350] ) ] ) (C {(chmod)} {(Lit_Other '+') (x)} {(nul_to_q_textconv)}) (C {(test_expect_success)} {(SQ <'setup textconv filters'>)} { (SQ <'\n'> <'\techo a diff=foo >.gitattributes &&\n'> <'\tgit config diff.foo.textconv "\\"$(pwd)\\""/nul_to_q_textconv\n'> ) } ) (C {(test_expect_success)} {(SQ <'grep does not honor textconv'>)} {(SQ <'\n'> <'\ttest_must_fail git grep Qfile\n'>)} ) (C {(test_expect_success)} {(SQ <'grep --textconv honors textconv'>)} { (SQ <'\n'> <'\techo "a:binaryQfile" >expect &&\n'> <'\tgit grep --textconv Qfile >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'grep --no-textconv does not honor textconv'>)} {(SQ <'\n'> <'\ttest_must_fail git grep --no-textconv Qfile\n'>)} ) (C {(test_expect_success)} {(SQ <'grep --textconv blob honors textconv'>)} { (SQ <'\n'> <'\techo "HEAD:a:binaryQfile" >expect &&\n'> <'\tgit grep --textconv Qfile HEAD:a >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_done)}) ] )