(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:'Pathspec restrictions\n' span_id:15) (Token id:Id.Lit_Chars val:'\n' span_id:16) (Token id:Id.Lit_Chars val:'Prepare:\n' span_id:17) (Token id:Id.Lit_Chars val:' file0\n' span_id:18) (Token id:Id.Lit_Chars val:' path1/file1\n' span_id:19) ) } spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.Sentence child: (C {(.)} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) (/diff-lib.sh)}) terminator: (Token id:Id.Op_Semi val:';' span_id:33) ) (C {(test_expect_success)} {(setup)} { (SQ (Token id:Id.Lit_Chars val:'echo frotz >file0 &&\n' span_id:47) (Token id:Id.Lit_Chars val:' mkdir path1 &&\n' span_id:48) (Token id:Id.Lit_Chars val:' echo rezrov >path1/file1 &&\n' span_id:49) (Token id: Id.Lit_Chars val: ' git update-index --add file0 path1/file1 &&\n' span_id: 50 ) (Token id:Id.Lit_Chars val:' tree=$(git write-tree) &&\n' span_id:51) (Token id:Id.Lit_Chars val:' echo "$tree" &&\n' span_id:52) (Token id:Id.Lit_Chars val:' echo nitfol >file0 &&\n' span_id:53) (Token id:Id.Lit_Chars val:' echo yomin >path1/file1 &&\n' span_id:54) (Token id:Id.Lit_Chars val:' git update-index file0 path1/file1' span_id:55) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:61) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:64) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:65)) (OF)} here_end_span_id: 68 ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'limit to path should show nothing' span_id:74))} { (SQ (Token id: Id.Lit_Chars val: 'git diff-index --cached $tree -- path >current &&\n' span_id: 80 ) (Token id:Id.Lit_Chars val:' compare_diff_raw current expected' span_id:81) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:87) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:90) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:91)) (OF)} here_end_span_id: 95 stdin_parts: [ ( ':100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n' ) ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'limit to path1 should show path1/file1' span_id:101))} { (SQ (Token id: Id.Lit_Chars val: 'git diff-index --cached $tree -- path1 >current &&\n' span_id: 107 ) (Token id:Id.Lit_Chars val:' compare_diff_raw current expected' span_id:108) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:114) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:117) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:118)) (OF) } here_end_span_id: 122 stdin_parts: [ ( ':100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n' ) ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'limit to path1/ should show path1/file1' span_id:128))} { (SQ (Token id: Id.Lit_Chars val: 'git diff-index --cached $tree -- path1/ >current &&\n' span_id: 134 ) (Token id:Id.Lit_Chars val:' compare_diff_raw current expected' span_id:135) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:141) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:144) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:145)) (OF) } here_end_span_id: 149 stdin_parts: [ ( ':100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n' ) ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'"*file1" should show path1/file1' span_id:155))} { (SQ (Token id: Id.Lit_Chars val: 'git diff-index --cached $tree -- "*file1" >current &&\n' span_id: 161 ) (Token id:Id.Lit_Chars val:' compare_diff_raw current expected' span_id:162) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:168) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:171) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:172)) (OF) } here_end_span_id: 176 stdin_parts: [ ( ':100644 100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df dca6b92303befc93086aa025d90a5facd7eb2812 M\tfile0\n' ) ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'limit to file0 should show file0' span_id:182))} { (SQ (Token id: Id.Lit_Chars val: 'git diff-index --cached $tree -- file0 >current &&\n' span_id: 188 ) (Token id:Id.Lit_Chars val:' compare_diff_raw current expected' span_id:189) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:195) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:198) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:199)) (OF) } here_end_span_id: 202 ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'limit to file0/ should emit nothing.' span_id:208))} { (SQ (Token id: Id.Lit_Chars val: 'git diff-index --cached $tree -- file0/ >current &&\n' span_id: 214 ) (Token id:Id.Lit_Chars val:' compare_diff_raw current expected' span_id:215) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'diff-tree pathspec' span_id:222))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:226) (Token id:Id.Lit_Chars val:'\ttree2=$(git write-tree) &&\n' span_id:227) (Token id:Id.Lit_Chars val:'\techo "$tree2" &&\n' span_id:228) (Token id: Id.Lit_Chars val: '\tgit diff-tree -r --name-only $tree $tree2 -- pa path1/a >current &&\n' span_id: 229 ) (Token id:Id.Lit_Chars val:'\t>expected &&\n' span_id:230) (Token id:Id.Lit_Chars val:'\ttest_cmp expected current\n' span_id:231) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'diff-tree with wildcard shows dir also matches' span_id:238))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:242) (Token id: Id.Lit_Chars val: '\tgit diff-tree --name-only $EMPTY_TREE $tree -- "f*" >result &&\n' span_id: 243 ) (Token id:Id.Lit_Chars val:'\techo file0 >expected &&\n' span_id:244) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:245) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'diff-tree -r with wildcard' span_id:252))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:256) (Token id: Id.Lit_Chars val: '\tgit diff-tree -r --name-only $EMPTY_TREE $tree -- "*file1" >result &&\n' span_id: 257 ) (Token id:Id.Lit_Chars val:'\techo path1/file1 >expected &&\n' span_id:258) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:259) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'diff-tree with wildcard shows dir also matches' span_id:266))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:270) (Token id: Id.Lit_Chars val: '\tgit diff-tree --name-only $tree $tree2 -- "path1/f*" >result &&\n' span_id: 271 ) (Token id:Id.Lit_Chars val:'\techo path1 >expected &&\n' span_id:272) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:273) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'diff-tree -r with wildcard from beginning' span_id:280))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:284) (Token id: Id.Lit_Chars val: '\tgit diff-tree -r --name-only $tree $tree2 -- "path1/*file1" >result &&\n' span_id: 285 ) (Token id:Id.Lit_Chars val:'\techo path1/file1 >expected &&\n' span_id:286) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:287) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'diff-tree -r with wildcard' span_id:294))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:298) (Token id: Id.Lit_Chars val: '\tgit diff-tree -r --name-only $tree $tree2 -- "path1/f*" >result &&\n' span_id: 299 ) (Token id:Id.Lit_Chars val:'\techo path1/file1 >expected &&\n' span_id:300) (Token id:Id.Lit_Chars val:'\ttest_cmp expected result\n' span_id:301) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup submodules' span_id:308))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:312) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:313) (Token id:Id.Lit_Chars val:'\tgit init submod &&\n' span_id:314) (Token id: Id.Lit_Chars val: '\t( cd submod && test_commit first; ) &&\n' span_id: 315 ) (Token id:Id.Lit_Chars val:'\tgit add submod &&\n' span_id:316) (Token id:Id.Lit_Chars val:'\tgit commit -m first &&\n' span_id:317) (Token id:Id.Lit_Chars val:'\t( cd submod && test_commit second; ) &&\n' span_id:318) (Token id:Id.Lit_Chars val:'\tgit add submod &&\n' span_id:319) (Token id:Id.Lit_Chars val:'\tgit commit -m second\n' span_id:320) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'diff-tree ignores trailing slash on submodule path' span_id: 327 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:331) (Token id: Id.Lit_Chars val: '\tgit diff --name-only HEAD^ HEAD submod >expect &&\n' span_id: 332 ) (Token id:Id.Lit_Chars val:'\tgit diff --name-only HEAD^ HEAD submod/ >actual &&\n' span_id:333) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:334) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'diff multiple wildcard pathspecs' span_id:341))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:345) (Token id:Id.Lit_Chars val:'\tmkdir path2 &&\n' span_id:346) (Token id:Id.Lit_Chars val:'\techo rezrov >path2/file1 &&\n' span_id:347) (Token id: Id.Lit_Chars val: '\tgit update-index --add path2/file1 &&\n' span_id: 348 ) (Token id:Id.Lit_Chars val:'\ttree3=$(git write-tree) &&\n' span_id:349) (Token id: Id.Lit_Chars val: '\tgit diff --name-only $tree $tree3 -- "path2*1" "path1*1" >actual &&\n' span_id: 350 ) (Token id:Id.Lit_Chars val:'\tcat <<-\\EOF >expect &&\n' span_id:351) (Token id:Id.Lit_Chars val:'\tpath1/file1\n' span_id:352) (Token id:Id.Lit_Chars val:'\tpath2/file1\n' span_id:353) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:354) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:355) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'diff-cache ignores trailing slash on submodule path' span_id: 362 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:366) (Token id: Id.Lit_Chars val: '\tgit diff --name-only HEAD^ submod >expect &&\n' span_id: 367 ) (Token id:Id.Lit_Chars val:'\tgit diff --name-only HEAD^ submod/ >actual &&\n' span_id:368) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:369) ) } ) (C {(test_done)}) ] )