(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'miscellaneous rev-list tests'>)} spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {<setup>} { (SQ <'\n'> <'\techo content1 >wanted_file &&\n'> <'\techo content2 >unwanted_file &&\n'> <'\tgit add wanted_file unwanted_file &&\n'> <'\tgit commit -m one\n'> ) } ) (C {<test_expect_success>} {(SQ <'rev-list --objects heeds pathspecs'>)} { (SQ <'\n'> <'\tgit rev-list --objects HEAD -- wanted_file >output &&\n'> <'\tgrep wanted_file output &&\n'> <'\t! grep unwanted_file output\n'> ) } ) (C {<test_expect_success>} {(SQ <'rev-list --objects with pathspecs and deeper paths'>)} { (SQ <'\n'> <'\tmkdir foo &&\n'> <'\t>foo/file &&\n'> <'\tgit add foo/file &&\n'> <'\tgit commit -m two &&\n'> <'\n'> <'\tgit rev-list --objects HEAD -- foo >output &&\n'> <'\tgrep foo/file output &&\n'> <'\n'> <'\tgit rev-list --objects HEAD -- foo/file >output &&\n'> <'\tgrep foo/file output &&\n'> <'\t! grep unwanted_file output\n'> ) } ) (C {<test_expect_success>} {(SQ <'rev-list --objects with pathspecs and copied files'>)} { (SQ <'\n'> <'\tgit checkout --orphan junio-testcase &&\n'> <'\tgit rm -rf . &&\n'> <'\n'> <'\tmkdir two &&\n'> <'\techo frotz >one &&\n'> <'\tcp one two/three &&\n'> <'\tgit add one two/three &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m that &&\n'> <'\n'> <'\tONE=$(git rev-parse HEAD:one) &&\n'> <'\tgit rev-list --objects HEAD two >output &&\n'> <'\tgrep "$ONE two/three" output &&\n'> <'\t! grep one output\n'> ) } ) (C {<test_expect_success>} {(SQ <'rev-list A..B and rev-list ^A B are the same'>)} { (SQ <'\n'> <'\tgit commit --allow-empty -m another &&\n'> <'\tgit tag -a -m "annotated" v1.0 &&\n'> <'\tgit rev-list --objects ^v1.0^ v1.0 >expect &&\n'> <'\tgit rev-list --objects v1.0^..v1.0 >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'propagate uninteresting flag down correctly'>)} { (SQ <'\n'> <'\tgit rev-list --objects ^HEAD^{tree} HEAD^{tree} >actual &&\n'> <'\t>expect &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'symleft flag bit is propagated down from tag'>)} { (SQ <'\n'> <'\tgit log --format="%m %s" --left-right v1.0...master >actual &&\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\t> two\n'> <'\t> one\n'> <'\t< another\n'> <'\t< that\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'rev-list can show index objects'>)} { (SQ <'\n'> <'\t# Of the blobs and trees in the index, note:\n'> <'\t#\n'> <'\t# - we do not show two/three, because it is the\n'> <'\t# same blob as "one", and we show objects only once\n'> <'\t#\n'> <'\t# - we do show the tree "two", because it has a valid cache tree\n'> <'\t# from the last commit\n'> <'\t#\n'> <'\t# - we do not show the root tree; since we updated the index, it\n'> <'\t# does not have a valid cache tree\n'> <'\t#\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\t8e4020bb5a8d8c873b25de15933e75cc0fc275df one\n'> <'\td9d3a7417b9605cfd88ee6306b28dadc29e6ab08 only-in-index\n'> <'\t9200b628cf9dc883a85a7abc8d6e6730baee589c two\n'> <'\tEOF\n'> <'\techo only-in-index >only-in-index &&\n'> <'\tgit add only-in-index &&\n'> <'\tgit rev-list --objects --indexed-objects >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'--bisect and --first-parent can not be combined'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-list --bisect --first-parent HEAD\n'>)} ) (C {<test_expect_success>} {(SQ <'--header shows a NUL after each commit'>)} { (SQ <'\n'> <'\t# We know that there is no Q in the true payload; names and\n'> <'\t# addresses of the authors and the committers do not have\n'> <'\t# any, and object names or header names do not, either.\n'> <'\tgit rev-list --header --max-count=2 HEAD |\n'> <'\tnul_to_q |\n'> <'\tgrep "^Q" >actual &&\n'> <'\tcat >expect <<-EOF &&\n'> <'\tQ$(git rev-parse HEAD~1)\n'> <'\tQ\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_done>}) ] )