]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6013-rev-list-reverse-parents.sh
The third batch
[thirdparty/git.git] / t / t6013-rev-list-reverse-parents.sh
CommitLineData
498bcd31
TR
1#!/bin/sh
2
3test_description='--reverse combines with --parents'
4
1550bb6e 5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
498bcd31
TR
8. ./test-lib.sh
9
10
11commit () {
12 test_tick &&
13 echo $1 > foo &&
14 git add foo &&
15 git commit -m "$1"
16}
17
18test_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 &&
1550bb6e 24 git checkout main &&
498bcd31
TR
25 git merge -s ours side &&
26 commit five
27 '
28
29test_expect_success '--reverse --parents --full-history combines correctly' '
1550bb6e 30 git rev-list --parents --full-history main -- foo |
94221d22 31 perl -e "print reverse <>" > expected &&
1550bb6e 32 git rev-list --reverse --parents --full-history main -- foo \
498bcd31 33 > actual &&
9c5b2fab 34 test_cmp expected actual
498bcd31
TR
35 '
36
37test_expect_success '--boundary does too' '
1550bb6e 38 git rev-list --boundary --parents --full-history main ^root -- foo |
94221d22 39 perl -e "print reverse <>" > expected &&
498bcd31 40 git rev-list --boundary --reverse --parents --full-history \
1550bb6e 41 main ^root -- foo > actual &&
9c5b2fab 42 test_cmp expected actual
498bcd31
TR
43 '
44
45test_done