(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'git grep in binary files' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:18))} { (DQ ('\n') ("\techo 'binaryQfile' | q_to_nul >a &&\n") ('\tgit add a &&\n') ('\tgit commit -m.\n') ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep ina a' span_id:32))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:36) (Token id: Id.Lit_Chars val: '\techo Binary file a matches >expect &&\n' span_id: 37 ) (Token id:Id.Lit_Chars val:'\tgit grep ina a >actual &&\n' span_id:38) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:39) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -ah ina a' span_id:46))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:50) (Token id:Id.Lit_Chars val:'\tgit grep -ah ina a >actual &&\n' span_id:51) (Token id:Id.Lit_Chars val:'\ttest_cmp a actual\n' span_id:52) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -I ina a' span_id:59))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:63) (Token id:Id.Lit_Chars val:'\t: >expect &&\n' span_id:64) (Token id:Id.Lit_Chars val:'\ttest_must_fail git grep -I ina a >actual &&\n' span_id:65) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:66) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -c ina a' span_id:73))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:77) (Token id:Id.Lit_Chars val:'\techo a:1 >expect &&\n' span_id:78) (Token id:Id.Lit_Chars val:'\tgit grep -c ina a >actual &&\n' span_id:79) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:80) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -l ina a' span_id:87))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:91) (Token id:Id.Lit_Chars val:'\techo a >expect &&\n' span_id:92) (Token id:Id.Lit_Chars val:'\tgit grep -l ina a >actual &&\n' span_id:93) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:94) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -L bar a' span_id:101))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:105) (Token id:Id.Lit_Chars val:'\techo a >expect &&\n' span_id:106) (Token id:Id.Lit_Chars val:'\tgit grep -L bar a >actual &&\n' span_id:107) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:108) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -q ina a' span_id:115))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:119) (Token id:Id.Lit_Chars val:'\t: >expect &&\n' span_id:120) (Token id:Id.Lit_Chars val:'\tgit grep -q ina a >actual &&\n' span_id:121) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:122) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -F ile a' span_id:129))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:133) (Token id:Id.Lit_Chars val:'\tgit grep -F ile a\n' span_id:134) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -Fi iLE a' span_id:141))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:145) (Token id:Id.Lit_Chars val:'\tgit grep -Fi iLE a\n' span_id:146) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep ile a' span_id:159))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:163) (Token id:Id.Lit_Chars val:'\tgit grep ile a\n' span_id:164) ) } ) (C {(test_expect_failure)} {(SQ (Token id:Id.Lit_Chars val:'git grep .fi a' span_id:171))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:175) (Token id:Id.Lit_Chars val:'\tgit grep .fi a\n' span_id:176) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -F y<NUL>f a' span_id:183))} {(DQ ('\n') ("\tprintf 'yQf' | q_to_nul >f &&\n") ('\tgit grep -f f -F a\n'))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -F y<NUL>x a' span_id:196))} {(DQ ('\n') ("\tprintf 'yQx' | q_to_nul >f &&\n") ('\ttest_must_fail git grep -f f -F a\n'))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -Fi Y<NUL>f a' span_id:209))} {(DQ ('\n') ("\tprintf 'YQf' | q_to_nul >f &&\n") ('\tgit grep -f f -Fi a\n'))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep -Fi Y<NUL>x a' span_id:222))} {(DQ ('\n') ("\tprintf 'YQx' | q_to_nul >f &&\n") ('\ttest_must_fail git grep -f f -Fi a\n'))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep y<NUL>f a' span_id:235))} {(DQ ('\n') ("\tprintf 'yQf' | q_to_nul >f &&\n") ('\tgit grep -f f a\n'))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git grep y<NUL>x a' span_id:248))} {(DQ ('\n') ("\tprintf 'yQx' | q_to_nul >f &&\n") ('\ttest_must_fail git grep -f f a\n'))} ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep respects binary diff attribute' span_id:261))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:265) (Token id:Id.Lit_Chars val:'\techo text >t &&\n' span_id:266) (Token id:Id.Lit_Chars val:'\tgit add t &&\n' span_id:267) (Token id:Id.Lit_Chars val:'\techo t:text >expect &&\n' span_id:268) (Token id:Id.Lit_Chars val:'\tgit grep text t >actual &&\n' span_id:269) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:270) (Token id:Id.Lit_Chars val:'\techo "t -diff" >.gitattributes &&\n' span_id:271) (Token id: Id.Lit_Chars val: '\techo "Binary file t matches" >expect &&\n' span_id: 272 ) (Token id:Id.Lit_Chars val:'\tgit grep text t >actual &&\n' span_id:273) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:274) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep --cached respects binary diff attribute' span_id:281))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:285) (Token id:Id.Lit_Chars val:'\tgit grep --cached text t >actual &&\n' span_id:286) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:287) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'grep --cached respects binary diff attribute (2)' span_id: 294 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:298) (Token id:Id.Lit_Chars val:'\tgit add .gitattributes &&\n' span_id:299) (Token id:Id.Lit_Chars val:'\trm .gitattributes &&\n' span_id:300) (Token id:Id.Lit_Chars val:'\tgit grep --cached text t >actual &&\n' span_id:301) (Token id:Id.Lit_Chars val:'\ttest_when_finished "git rm --cached .gitattributes" &&\n' span_id:302) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git checkout .gitattributes" &&\n' span_id: 303 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:304) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep revision respects binary diff attribute' span_id:311))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:315) (Token id:Id.Lit_Chars val:'\tgit commit -m new &&\n' span_id:316) (Token id:Id.Lit_Chars val:'\techo "Binary file HEAD:t matches" >expect &&\n' span_id:317) (Token id:Id.Lit_Chars val:'\tgit grep text HEAD -- t >actual &&\n' span_id:318) (Token id:Id.Lit_Chars val:'\ttest_when_finished "git reset HEAD^" &&\n' span_id:319) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:320) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep respects not-binary diff attribute' span_id:327))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:331) (Token id:Id.Lit_Chars val:'\techo binQary | q_to_nul >b &&\n' span_id:332) (Token id:Id.Lit_Chars val:'\tgit add b &&\n' span_id:333) (Token id: Id.Lit_Chars val: '\techo "Binary file b matches" >expect &&\n' span_id: 334 ) (Token id:Id.Lit_Chars val:'\tgit grep bin b >actual &&\n' span_id:335) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:336) (Token id:Id.Lit_Chars val:'\techo "b diff" >.gitattributes &&\n' span_id:337) (Token id:Id.Lit_Chars val:'\techo "b:binQary" >expect &&\n' span_id:338) (Token id:Id.Lit_Chars val:'\tgit grep bin b >actual.raw &&\n' span_id:339) (Token id:Id.Lit_Chars val:'\tnul_to_q <actual.raw >actual &&\n' span_id:340) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:341) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:347) fd: -1 arg_word: {(nul_to_q_textconv)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:350) fd: -1 here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:352))} here_end_span_id: 357 stdin_parts: [('#!/bin/sh\n') ('"$PERL_PATH" -pe \'y/\\000/Q/\' < "$1"\n')] ) ] ) (C {(chmod)} {(Id.Lit_Other '+') (x)} {(nul_to_q_textconv)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup textconv filters' span_id:369))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:373) (Token id:Id.Lit_Chars val:'\techo a diff=foo >.gitattributes &&\n' span_id:374) (Token id: Id.Lit_Chars val: '\tgit config diff.foo.textconv "\\"$(pwd)\\""/nul_to_q_textconv\n' span_id: 375 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep does not honor textconv' span_id:382))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:386) (Token id:Id.Lit_Chars val:'\ttest_must_fail git grep Qfile\n' span_id:387) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep --textconv honors textconv' span_id:394))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:398) (Token id:Id.Lit_Chars val:'\techo "a:binaryQfile" >expect &&\n' span_id:399) (Token id:Id.Lit_Chars val:'\tgit grep --textconv Qfile >actual &&\n' span_id:400) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:401) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep --no-textconv does not honor textconv' span_id:408))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:412) (Token id: Id.Lit_Chars val: '\ttest_must_fail git grep --no-textconv Qfile\n' span_id: 413 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'grep --textconv blob honors textconv' span_id:420))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:424) (Token id: Id.Lit_Chars val: '\techo "HEAD:a:binaryQfile" >expect &&\n' span_id: 425 ) (Token id:Id.Lit_Chars val:'\tgit grep --textconv Qfile HEAD:a >actual &&\n' span_id:426) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:427) ) } ) (C {(test_done)}) ] )