Skip to content

Commit 3fc0dbf

Browse files
jrngitster
authored andcommitted
tests: teach verify_parents to check for extra parents
Currently verify_parents only makes sure that the earlier parents of HEAD match the commits given, and does not care if there are more parents. This makes it harder than one would like to check that, for example, parent reduction works correctly when making an octopus. Fix it by checking that HEAD^(n+1) is not a valid commit name. Noticed while working on a new test that was supposed to create a fast-forward one commit ahead but actually created a merge. Reported-by: Junio C Hamano <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 73151df commit 3fc0dbf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/t7600-merge.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ verify_parents () {
8989
i=$(expr $i + 1) ||
9090
return 1
9191
done &&
92+
test_must_fail git rev-parse --verify "HEAD^$i" &&
9293
test_cmp parents.expected parents.actual
9394
}
9495

0 commit comments

Comments
 (0)