This could lead to bad results when doing ls-tree -z
for v2 import in case there's multiple files. In any case,
the `local $/ = "\0"' in Import.pm is also eliminated to
reduce potential confusion and surprises.
sub qx {
my $fh = popen(@_);
if (wantarray) {
sub qx {
my $fh = popen(@_);
if (wantarray) {
my @ret = <$fh>;
close $fh; # caller should check $?
@ret;
my @ret = <$fh>;
close $fh; # caller should check $?
@ret;
chomp($self->{tip} = $git->qx(qw(rev-parse --revs-only), $ref));
die "fatal: rev-parse --revs-only $ref: \$?=$?" if $?;
if ($self->{path_type} ne '2/38' && $self->{tip}) {
chomp($self->{tip} = $git->qx(qw(rev-parse --revs-only), $ref));
die "fatal: rev-parse --revs-only $ref: \$?=$?" if $?;
if ($self->{path_type} ne '2/38' && $self->{tip}) {
- local $/ = "\0";
- my @t = $git->qx(qw(ls-tree -r -z --name-only), $ref);
+ my $t = $git->qx(qw(ls-tree -r -z --name-only), $ref);
die "fatal: ls-tree -r -z --name-only $ref: \$?=$?" if $?;
die "fatal: ls-tree -r -z --name-only $ref: \$?=$?" if $?;
- chomp @t;
- $self->{-tree} = { map { $_ => 1 } @t };
+ $self->{-tree} = { map { $_ => 1 } split(/\0/, $t) };
}
$in_r = $self->{in} = $git->popen(qw(fast-import
--quiet --done --date-format=raw),
}
$in_r = $self->{in} = $git->popen(qw(fast-import
--quiet --done --date-format=raw),