rev-list: Demonstrate breakage with --ancestry-path --all

The option added by commit ebdc94f3 (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 <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brad King committed Aug 25, 2011 at 12:49 UTC 81f4953120f021832a0023dc704a0d7eb0ddf475
1 file changed +35
t/t6019-rev-list-ancestry-path.sh
+35
@@ -70,4 +70,39 @@ test_expect_success 'rev-list --ancestry-patch D..M -- M.t' '
70 test_cmp expect actual
71 '
72
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 +
108 test_done