3 test_description
='rev-list testing in-commit-order'
7 test_expect_success
'setup a commit history with trees, blobs' '
8 for x in one two three four
12 git commit -m "add file $x" ||
18 git commit -m "remove $x" ||
23 test_expect_success
'rev-list --in-commit-order' '
24 git rev-list --in-commit-order --objects HEAD >actual.raw &&
25 cut -c 1-40 >actual <actual.raw &&
27 git cat-file --batch-check="%(objectname)" >expect.raw <<-\EOF &&
39 # HEAD~3^{tree} skipped, same as HEAD~1^{tree}
41 # HEAD~4^{tree} skipped, same as HEAD^{tree}
45 grep -v "#" >expect <expect.raw &&
47 test_cmp expect actual
50 test_expect_success
'rev-list lists blobs and trees after commits' '
51 git rev-list --objects HEAD >actual.raw &&
52 cut -c 1-40 >actual <actual.raw &&
54 git cat-file --batch-check="%(objectname)" >expect.raw <<-\EOF &&
68 # HEAD~3^{tree} skipped, same as HEAD~1^{tree}
69 # HEAD~4^{tree} skipped, same as HEAD^{tree}
72 grep -v "#" >expect <expect.raw &&
74 test_cmp expect actual