Code

git-cvsexportcommit can't handle merge commits correctly
authorPeter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
Fri, 7 Jul 2006 10:55:41 +0000 (12:55 +0200)
committerJunio C Hamano <junkio@cox.net>
Sun, 9 Jul 2006 07:46:56 +0000 (00:46 -0700)
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>
git-cvsexportcommit.perl

index d1051d074bcf685dcc57cae90cca9053dc71a76f..5dcb2f9a8ecdf43e73ae31bf8ba7dff27acaa367 100755 (executable)
@@ -63,15 +63,15 @@ foreach my $p (@commit) {
 }
 
 if ($parent) {
+    my $found;
     # double check that it's a valid parent
     foreach my $p (@parents) {
-       my $found;
        if ($p eq $parent) {
            $found = 1;
            last;
        }; # found it
-       die "Did not find $parent in the parents for this commit!";
     }
+    die "Did not find $parent in the parents for this commit!" if !$found;
 } else { # we don't have a parent from the cmdline...
     if (@parents == 1) { # it's safe to get it from the commit
        $parent = $parents[0];