git2spec.pl: handle empty merge commits
parent
4c2d98c75b
commit
8c2aa6161a
10
git2spec.pl
10
git2spec.pl
|
|
@ -5,6 +5,8 @@ sub create_patches {
|
||||||
my $pdir=shift;
|
my $pdir=shift;
|
||||||
my $n=1;
|
my $n=1;
|
||||||
my @lines;
|
my @lines;
|
||||||
|
my $fname;
|
||||||
|
my $f=0;
|
||||||
|
|
||||||
mkdir $pdir, 0755;
|
mkdir $pdir, 0755;
|
||||||
|
|
||||||
|
|
@ -12,9 +14,13 @@ sub create_patches {
|
||||||
|
|
||||||
while (<GIT>) {
|
while (<GIT>) {
|
||||||
if (/^From [a-z0-9]{40} .*$/) {
|
if (/^From [a-z0-9]{40} .*$/) {
|
||||||
my $fname = sprintf("%04d", $n++).".patch";
|
$fname = sprintf("%04d", $n++).".patch";
|
||||||
push @lines, $fname;
|
|
||||||
open FH, ">".$pdir."/".$fname;
|
open FH, ">".$pdir."/".$fname;
|
||||||
|
$f=1;
|
||||||
|
}
|
||||||
|
if (/^---$/ && $f == 1) {
|
||||||
|
push @lines, $fname;
|
||||||
|
$f=0;
|
||||||
}
|
}
|
||||||
print FH;
|
print FH;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue