3 test_description
='--ancestry-path'
7 # B---C---G---H---I---J
9 # A-------K---------------L--M
11 # D..M == E F G H I J K L M
12 # --ancestry-path D..M == E F H I J L M
15 # --ancestry-path D..M -- M.t == M
21 git merge
-s ours
-m "$2" "$1" &&
25 test_expect_success setup
'
43 test_expect_success
'rev-list D..M' '
44 for c in E F G H I J K L M; do echo $c; done >expect &&
45 git rev-list --format=%s D..M |
46 sed -e "/^commit /d" |
48 test_cmp expect actual
51 test_expect_success
'rev-list --ancestry-path D..M' '
52 for c in E F H I J L M; do echo $c; done >expect &&
53 git rev-list --ancestry-path --format=%s D..M |
54 sed -e "/^commit /d" |
56 test_cmp expect actual
59 test_expect_success
'rev-list D..M -- M.t' '
61 git rev-list --format=%s D..M -- M.t |
62 sed -e "/^commit /d" >actual &&
63 test_cmp expect actual
66 test_expect_success
'rev-list --ancestry-patch D..M -- M.t' '
68 git rev-list --ancestry-path --format=%s D..M -- M.t |
69 sed -e "/^commit /d" >actual &&
70 test_cmp expect actual
78 test_expect_success
'setup criss-cross' '
83 git checkout -b b master &&
85 git checkout -b c master &&
87 git checkout -b bc b -- &&
89 git checkout -b cb c -- &&
94 # no commits in bc descend from cb
95 test_expect_success
'criss-cross: rev-list --ancestry-path cb..bc' '
97 git rev-list --ancestry-path cb..bc > actual &&
98 test -z "$(cat actual)")
101 # no commits in repository descend from cb
102 test_expect_failure
'criss-cross: rev-list --ancestry-path --all ^cb' '
104 git rev-list --ancestry-path --all ^cb > actual &&
105 test -z "$(cat actual)")