(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 ls-tree test.\n' span_id:15) (Token id:Id.Lit_Chars val:'\n' span_id:16) (Token id:Id.Lit_Chars val:'This test runs git ls-tree with the following in a tree.\n' span_id:17) (Token id:Id.Lit_Chars val:'\n' span_id:18) (Token id:Id.Lit_Chars val:' path0 - a file\n' span_id:19) (Token id:Id.Lit_Chars val:' path1\t- a symlink\n' span_id:20) (Token id:Id.Lit_Chars val:' path2/foo - a file in a directory\n' span_id:21) (Token id: Id.Lit_Chars val: ' path2/bazbo - a symlink in a directory\n' span_id: 22 ) (Token id:Id.Lit_Chars val:' path2/baz/b - a file in a directory in a directory\n' span_id:23) (Token id:Id.Lit_Chars val:'\n' span_id:24) (Token id: Id.Lit_Chars val: 'The new path restriction code should do the right thing for path2 and\n' span_id: 25 ) (Token id:Id.Lit_Chars val:'path2/baz. Also path0/ should snow nothing.\n' span_id:26) ) } spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:39))} { (SQ (Token id:Id.Lit_Chars val:'mkdir path2 path2/baz &&\n' span_id:45) (Token id:Id.Lit_Chars val:' echo Hi >path0 &&\n' span_id:46) (Token id:Id.Lit_Chars val:' test_ln_s_add path0 path1 &&\n' span_id:47) (Token id: Id.Lit_Chars val: ' test_ln_s_add ../path1 path2/bazbo &&\n' span_id: 48 ) (Token id:Id.Lit_Chars val:' echo Lo >path2/foo &&\n' span_id:49) (Token id:Id.Lit_Chars val:' echo Mi >path2/baz/b &&\n' span_id:50) (Token id:Id.Lit_Chars val:' find path? \\( -type f -o -type l \\) -print |\n' span_id:51) (Token id:Id.Lit_Chars val:' xargs git update-index --add &&\n' span_id:52) (Token id:Id.Lit_Chars val:' tree=$(git write-tree) &&\n' span_id:53) (Token id:Id.Lit_Chars val:' echo $tree' span_id:54) ) } ) (command.ShFunction name: test_output body: (command.BraceGroup children: [ (command.Simple words: [{(sed)} {(-e)} {(DQ ('s/ ') ($ Id.VSub_DollarName '$_x40') ('\t/ X\t/'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:76) fd: -1 arg_word: {(current)} ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:79) fd: -1 arg_word: {(check)} ) ] ) (C {(test_cmp)} {(expected)} {(check)}) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree plain' span_id:97))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree >current &&\n' span_id:103) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:104) (Token id:Id.Lit_Chars val:'100644 blob X\tpath0\n' span_id:105) (Token id:Id.Lit_Chars val:'120000 blob X\tpath1\n' span_id:106) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2\n' span_id:107) (Token id:Id.Lit_Chars val:'EOF\n' span_id:108) (Token id:Id.Lit_Chars val:' test_output' span_id:109) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree recursive' span_id:118))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree -r $tree >current &&\n' span_id:124) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:125) (Token id:Id.Lit_Chars val:'100644 blob X\tpath0\n' span_id:126) (Token id:Id.Lit_Chars val:'120000 blob X\tpath1\n' span_id:127) (Token id:Id.Lit_Chars val:'100644 blob X\tpath2/baz/b\n' span_id:128) (Token id:Id.Lit_Chars val:'120000 blob X\tpath2/bazbo\n' span_id:129) (Token id:Id.Lit_Chars val:'100644 blob X\tpath2/foo\n' span_id:130) (Token id:Id.Lit_Chars val:'EOF\n' span_id:131) (Token id:Id.Lit_Chars val:' test_output' span_id:132) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree recursive with -t' span_id:141))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree -r -t $tree >current &&\n' span_id:147) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:148) (Token id:Id.Lit_Chars val:'100644 blob X\tpath0\n' span_id:149) (Token id:Id.Lit_Chars val:'120000 blob X\tpath1\n' span_id:150) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2\n' span_id:151) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2/baz\n' span_id:152) (Token id:Id.Lit_Chars val:'100644 blob X\tpath2/baz/b\n' span_id:153) (Token id:Id.Lit_Chars val:'120000 blob X\tpath2/bazbo\n' span_id:154) (Token id:Id.Lit_Chars val:'100644 blob X\tpath2/foo\n' span_id:155) (Token id:Id.Lit_Chars val:'EOF\n' span_id:156) (Token id:Id.Lit_Chars val:' test_output' span_id:157) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree recursive with -d' span_id:166))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree -r -d $tree >current &&\n' span_id:172) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:173) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2\n' span_id:174) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2/baz\n' span_id:175) (Token id:Id.Lit_Chars val:'EOF\n' span_id:176) (Token id:Id.Lit_Chars val:' test_output' span_id:177) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree filtered with path' span_id:186))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree path >current &&\n' span_id:192) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:193) (Token id:Id.Lit_Chars val:'EOF\n' span_id:194) (Token id:Id.Lit_Chars val:' test_output' span_id:195) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree filtered with path1 path0' span_id:211))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree path1 path0 >current &&\n' span_id:217) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:218) (Token id:Id.Lit_Chars val:'100644 blob X\tpath0\n' span_id:219) (Token id:Id.Lit_Chars val:'120000 blob X\tpath1\n' span_id:220) (Token id:Id.Lit_Chars val:'EOF\n' span_id:221) (Token id:Id.Lit_Chars val:' test_output' span_id:222) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree filtered with path0/' span_id:231))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree path0/ >current &&\n' span_id:237) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:238) (Token id:Id.Lit_Chars val:'EOF\n' span_id:239) (Token id:Id.Lit_Chars val:' test_output' span_id:240) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree filtered with path2' span_id:255))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree path2 >current &&\n' span_id:261) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:262) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2\n' span_id:263) (Token id:Id.Lit_Chars val:'EOF\n' span_id:264) (Token id:Id.Lit_Chars val:' test_output' span_id:265) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree filtered with path2/' span_id:277))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree path2/ >current &&\n' span_id:283) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:284) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2/baz\n' span_id:285) (Token id:Id.Lit_Chars val:'120000 blob X\tpath2/bazbo\n' span_id:286) (Token id:Id.Lit_Chars val:'100644 blob X\tpath2/foo\n' span_id:287) (Token id:Id.Lit_Chars val:'EOF\n' span_id:288) (Token id:Id.Lit_Chars val:' test_output' span_id:289) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree filtered with path2/baz' span_id:304))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree path2/baz >current &&\n' span_id:310) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:311) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2/baz\n' span_id:312) (Token id:Id.Lit_Chars val:'EOF\n' span_id:313) (Token id:Id.Lit_Chars val:' test_output' span_id:314) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree filtered with path2/bak' span_id:323))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree $tree path2/bak >current &&\n' span_id:329) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:330) (Token id:Id.Lit_Chars val:'EOF\n' span_id:331) (Token id:Id.Lit_Chars val:' test_output' span_id:332) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree -t filtered with path2/bak' span_id:341))} { (SQ (Token id:Id.Lit_Chars val:'git ls-tree -t $tree path2/bak >current &&\n' span_id:347) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:348) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2\n' span_id:349) (Token id:Id.Lit_Chars val:'EOF\n' span_id:350) (Token id:Id.Lit_Chars val:' test_output' span_id:351) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'ls-tree with one path a prefix of the other' span_id:360))} { (SQ (Token id: Id.Lit_Chars val: 'git ls-tree $tree path2/baz path2/bazbo >current &&\n' span_id: 366 ) (Token id:Id.Lit_Chars val:' cat >expected <<\\EOF &&\n' span_id:367) (Token id:Id.Lit_Chars val:'040000 tree X\tpath2/baz\n' span_id:368) (Token id:Id.Lit_Chars val:'120000 blob X\tpath2/bazbo\n' span_id:369) (Token id:Id.Lit_Chars val:'EOF\n' span_id:370) (Token id:Id.Lit_Chars val:' test_output' span_id:371) ) } ) (C {(test_done)}) ] )