Skip to content

Commit 81f4953

Browse files
bradkinggitster
authored andcommitted
rev-list: Demonstrate breakage with --ancestry-path --all
The option added by commit ebdc94f (revision: --ancestry-path, 2010-04-20) does not work properly in combination with --all, at least in the case of a criss-cross merge: b---bc / \ / a X \ / \ c---cb There are no descendants of 'cb' in the history. The command git rev-list --ancestry-path cb..bc correctly reports no commits. However, the command git rev-list --ancestry-path --all ^cb reports 'bc'. Add a test case to t6019-rev-list-ancestry-path demonstrating this breakage. Signed-off-by: Brad King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cb7529e commit 81f4953

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

t/t6019-rev-list-ancestry-path.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,39 @@ test_expect_success 'rev-list --ancestry-patch D..M -- M.t' '
7070
test_cmp expect actual
7171
'
7272

73+
# b---bc
74+
# / \ /
75+
# a X
76+
# \ / \
77+
# c---cb
78+
test_expect_success 'setup criss-cross' '
79+
mkdir criss-cross &&
80+
(cd criss-cross &&
81+
git init &&
82+
test_commit A &&
83+
git checkout -b b master &&
84+
test_commit B &&
85+
git checkout -b c master &&
86+
test_commit C &&
87+
git checkout -b bc b -- &&
88+
git merge c &&
89+
git checkout -b cb c -- &&
90+
git merge b &&
91+
git checkout master)
92+
'
93+
94+
# no commits in bc descend from cb
95+
test_expect_success 'criss-cross: rev-list --ancestry-path cb..bc' '
96+
(cd criss-cross &&
97+
git rev-list --ancestry-path cb..bc > actual &&
98+
test -z "$(cat actual)")
99+
'
100+
101+
# no commits in repository descend from cb
102+
test_expect_failure 'criss-cross: rev-list --ancestry-path --all ^cb' '
103+
(cd criss-cross &&
104+
git rev-list --ancestry-path --all ^cb > actual &&
105+
test -z "$(cat actual)")
106+
'
107+
73108
test_done

0 commit comments

Comments
 (0)