Merge branch 'ja/doc-synopsis-markup'
[git/gitster.git] / t / t6013-rev-list-reverse-parents.sh
blob4128269c1d481bf4837e62fdbce0982196e16d33
1 #!/bin/sh
3 test_description='--reverse combines with --parents'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
12 commit () {
13 test_tick &&
14 echo $1 > foo &&
15 git add foo &&
16 git commit -m "$1"
19 test_expect_success 'set up --reverse example' '
20 commit one &&
21 git tag root &&
22 commit two &&
23 git checkout -b side HEAD^ &&
24 commit three &&
25 git checkout main &&
26 git merge -s ours side &&
27 commit five
30 test_expect_success '--reverse --parents --full-history combines correctly' '
31 git rev-list --parents --full-history main -- foo |
32 perl -e "print reverse <>" > expected &&
33 git rev-list --reverse --parents --full-history main -- foo \
34 > actual &&
35 test_cmp expected actual
38 test_expect_success '--boundary does too' '
39 git rev-list --boundary --parents --full-history main ^root -- foo |
40 perl -e "print reverse <>" > expected &&
41 git rev-list --boundary --reverse --parents --full-history \
42 main ^root -- foo > actual &&
43 test_cmp expected actual
46 test_done