3 test_description
='rev-list testing in-commit-order'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'setup a commit history with trees, blobs' '
9 for x in one two three four
13 git commit -m "add file $x" ||
19 git commit -m "remove $x" ||
24 test_expect_success
'rev-list --in-commit-order' '
25 git rev-list --in-commit-order --objects HEAD >actual.raw &&
26 cut -d" " -f1 >actual <actual.raw &&
28 git cat-file --batch-check="%(objectname)" >expect.raw <<-\EOF &&
40 # HEAD~3^{tree} skipped, same as HEAD~1^{tree}
42 # HEAD~4^{tree} skipped, same as HEAD^{tree}
46 grep -v "#" >expect <expect.raw &&
48 test_cmp expect actual
51 test_expect_success
'rev-list lists blobs and trees after commits' '
52 git rev-list --objects HEAD >actual.raw &&
53 cut -d" " -f1 >actual <actual.raw &&
55 git cat-file --batch-check="%(objectname)" >expect.raw <<-\EOF &&
69 # HEAD~3^{tree} skipped, same as HEAD~1^{tree}
70 # HEAD~4^{tree} skipped, same as HEAD^{tree}
73 grep -v "#" >expect <expect.raw &&
75 test_cmp expect actual