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 <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed May 6, 2011 at 16:00 UTC 3fc0dbf00ba5191c6aa7090a19fb9324ca348077
1 file changed +1
t/t7600-merge.sh
+1
@@ -89,6 +89,7 @@ verify_parents () {
89 i=$(expr $i + 1) ||
90 return 1
91 done &&
92 + test_must_fail git rev-parse --verify "HEAD^$i" &&
93 test_cmp parents.expected parents.actual
94 }
95