]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Import.pm
git: ->qx: respect caller's $/ in array context
[public-inbox.git] / lib / PublicInbox / Import.pm
index a070aa1e9be0f6969d09eb1111fd5494b8320b5b..e803ee74c2b8d06c11e7361ef0f32a5d5fd1363e 100644 (file)
@@ -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),