Skip to content

Commit 135a522

Browse files
Peter BaumannJunio C Hamano
authored andcommitted
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>
1 parent d9bffc0 commit 135a522

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-cvsexportcommit.perl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@
6363
}
6464

6565
if ($parent) {
66+
my $found;
6667
# double check that it's a valid parent
6768
foreach my $p (@parents) {
68-
my $found;
6969
if ($p eq $parent) {
7070
$found = 1;
7171
last;
7272
}; # found it
73-
die "Did not find $parent in the parents for this commit!";
7473
}
74+
die "Did not find $parent in the parents for this commit!" if !$found;
7575
} else { # we don't have a parent from the cmdline...
7676
if (@parents == 1) { # it's safe to get it from the commit
7777
$parent = $parents[0];

0 commit comments

Comments
 (0)