about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/Git.pm1
-rw-r--r--lib/PublicInbox/Import.pm6
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index ac7ff267..e176921c 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -364,7 +364,6 @@ sub popen {
 sub qx {
         my $fh = popen(@_);
         if (wantarray) {
-                local $/ = "\n";
                 my @ret = <$fh>;
                 close $fh; # caller should check $?
                 @ret;
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index a070aa1e..e803ee74 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -68,11 +68,9 @@ sub gfi_start {
                 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 $?;
-                        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),