Code

revision: --ancestry-path
[git.git] / t / t6019-rev-list-ancestry-path.sh
1 #!/bin/sh
3 test_description='--ancestry-path'
5 #          D---E-------F
6 #         /     \       \
7 #    B---C---G---H---I---J
8 #   /                     \
9 #  A-------K---------------L--M
10 #
11 #  D..M                 == E F G H I J K L M
12 #  --ancestry-path D..M == E F H I J L M
14 . ./test-lib.sh
16 test_merge () {
17         test_tick &&
18         git merge -s ours -m "$2" "$1" &&
19         git tag "$2"
20 }
22 test_expect_success setup '
23         test_commit A &&
24         test_commit B &&
25         test_commit C &&
26         test_commit D &&
27         test_commit E &&
28         test_commit F &&
29         git reset --hard C &&
30         test_commit G &&
31         test_merge E H &&
32         test_commit I &&
33         test_merge F J &&
34         git reset --hard A &&
35         test_commit K &&
36         test_merge J L &&
37         test_commit M
38 '
40 test_expect_success 'rev-list D..M' '
41         for c in E F G H I J K L M; do echo $c; done >expect &&
42         git rev-list --format=%s D..M |
43         sed -e "/^commit /d" |
44         sort >actual &&
45         test_cmp expect actual
46 '
48 test_expect_success 'rev-list --ancestry-path D..M' '
49         for c in E F H I J L M; do echo $c; done >expect &&
50         git rev-list --ancestry-path --format=%s D..M |
51         sed -e "/^commit /d" |
52         sort >actual &&
53         test_cmp expect actual
54 '
56 test_done