surround %s with quotes when failed to lookup commit
[git/debian.git] / t / t6013-rev-list-reverse-parents.sh
blob39793cbbd661afe7fe9b9bab2302b023e4ef1d0a
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-lib.sh
11 commit () {
12 test_tick &&
13 echo $1 > foo &&
14 git add foo &&
15 git commit -m "$1"
18 test_expect_success 'set up --reverse example' '
19 commit one &&
20 git tag root &&
21 commit two &&
22 git checkout -b side HEAD^ &&
23 commit three &&
24 git checkout main &&
25 git merge -s ours side &&
26 commit five
29 test_expect_success '--reverse --parents --full-history combines correctly' '
30 git rev-list --parents --full-history main -- foo |
31 perl -e "print reverse <>" > expected &&
32 git rev-list --reverse --parents --full-history main -- foo \
33 > actual &&
34 test_cmp expected actual
37 test_expect_success '--boundary does too' '
38 git rev-list --boundary --parents --full-history main ^root -- foo |
39 perl -e "print reverse <>" > expected &&
40 git rev-list --boundary --reverse --parents --full-history \
41 main ^root -- foo > actual &&
42 test_cmp expected actual
45 test_done