mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
Merge branch 'bk/maint-cvsexportcommit' into maint
* bk/maint-cvsexportcommit: cvsexportcommit: fix for commits that do not have parents
This commit is contained in:
commit
bfc07db575
|
@ -87,6 +87,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
my $noparent = "0000000000000000000000000000000000000000";
|
||||
if ($parent) {
|
||||
my $found;
|
||||
# double check that it's a valid parent
|
||||
|
@ -100,8 +101,10 @@
|
|||
} 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];
|
||||
} else { # or perhaps not!
|
||||
die "This commit has more than one parent -- please name the parent you want to use explicitly";
|
||||
} elsif (@parents == 0) { # there is no parent
|
||||
$parent = $noparent;
|
||||
} else { # cannot choose automatically from multiple parents
|
||||
die "This commit has more than one parent -- please name the parent you want to use explicitly";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,7 +124,11 @@
|
|||
}
|
||||
close MSG;
|
||||
|
||||
`git-diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
|
||||
if ($parent eq $noparent) {
|
||||
`git-diff-tree --binary -p --root $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
|
||||
} else {
|
||||
`git-diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
|
||||
}
|
||||
|
||||
## apply non-binary changes
|
||||
|
||||
|
|
Loading…
Reference in a new issue