git-cvsexportcommit can't handle merge commits correctly
git-cvsexportcommit should check if the parent (supplied on the cmdline) to use for a merge commit is one of the real parents of the merge. But it errors out if the _first_ parent doesn't match and never checks the other parents. Signed-off-by: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Peter Baumann committed
Jul 7, 2006 at 12:55 UTC
135a522e3f0ddc85664b3cd094918f095ac76d79
1 file changed
+2
-2
git-cvsexportcommit.perl
+2
-2
@@ -63,15 +63,15 @@ foreach my $p (@commit) {
63
}
64
65
if ($parent) {
66
+ my $found;
67
# double check that it's a valid parent
68
foreach my $p (@parents) {
68
- my $found;
69
if ($p eq $parent) {
70
$found = 1;
71
last;
72
}; # found it
73
- die "Did not find $parent in the parents for this commit!";
73
}
74
+ die "Did not find $parent in the parents for this commit!" if !$found;
75
} else { # we don't have a parent from the cmdline...
76
if (@parents == 1) { # it's safe to get it from the commit
77
$parent = $parents[0];