(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'git mktree'>)} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {<setup>} { (SQ <'\n'> <'\tfor d in a a. a0\n'> <'\tdo\n'> <'\t\tmkdir "$d" && echo "$d/one" >"$d/one" &&\n'> <'\t\tgit add "$d"\n'> <'\tdone &&\n'> <'\techo zero >one &&\n'> <'\tgit update-index --add --info-only one &&\n'> <'\tgit write-tree --missing-ok >tree.missing &&\n'> <'\tgit ls-tree $(cat tree.missing) >top.missing &&\n'> <'\tgit ls-tree -r $(cat tree.missing) >all.missing &&\n'> <'\techo one >one &&\n'> <'\tgit add one &&\n'> <'\tgit write-tree >tree &&\n'> <'\tgit ls-tree $(cat tree) >top &&\n'> <'\tgit ls-tree -r $(cat tree) >all &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -q -m one &&\n'> <'\tH=$(git rev-parse HEAD) &&\n'> <'\tgit update-index --add --cacheinfo 160000 $H sub &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -q -m two &&\n'> <'\tgit rev-parse HEAD^{tree} >tree.withsub &&\n'> <'\tgit ls-tree HEAD >top.withsub &&\n'> <'\tgit ls-tree -r HEAD >all.withsub\n'> ) } ) (C {<test_expect_success>} {(SQ <'ls-tree piped to mktree (1)'>)} {(SQ <'\n'> <'\tgit mktree <top >actual &&\n'> <'\ttest_cmp tree actual\n'>)} ) (C {<test_expect_success>} {(SQ <'ls-tree piped to mktree (2)'>)} {(SQ <'\n'> <'\tgit mktree <top.withsub >actual &&\n'> <'\ttest_cmp tree.withsub actual\n'>)} ) (C {<test_expect_success>} {(SQ <'ls-tree output in wrong order given to mktree (1)'>)} { (SQ <'\n'> <'\tperl -e "print reverse <>" <top |\n'> <'\tgit mktree >actual &&\n'> <'\ttest_cmp tree actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'ls-tree output in wrong order given to mktree (2)'>)} { (SQ <'\n'> <'\tperl -e "print reverse <>" <top.withsub |\n'> <'\tgit mktree >actual &&\n'> <'\ttest_cmp tree.withsub actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'allow missing object with --missing'>)} { (SQ <'\n'> <'\tgit mktree --missing <top.missing >actual &&\n'> <'\ttest_cmp tree.missing actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'mktree refuses to read ls-tree -r output (1)'>)} {(SQ <'\n'> <'\ttest_must_fail git mktree <all >actual\n'>)} ) (C {<test_expect_success>} {(SQ <'mktree refuses to read ls-tree -r output (2)'>)} {(SQ <'\n'> <'\ttest_must_fail git mktree <all.withsub >actual\n'>)} ) (C {<test_done>}) ] )