]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Git.pm
treewide: "require" + "use" cleanup and docs
[public-inbox.git] / lib / PublicInbox / Git.pm
index af3a5712cf79dec86c90e4f92eb9a2df87a3683e..6a527f82f9145ada72a1abbf053bf1987009283d 100644 (file)
@@ -10,7 +10,7 @@ package PublicInbox::Git;
 use strict;
 use warnings;
 use POSIX qw(dup2);
-require IO::Handle;
+use IO::Handle; # ->autoflush
 use PublicInbox::Spawn qw(spawn popen_rd);
 use PublicInbox::Tmpfile;
 use base qw(Exporter);
@@ -114,12 +114,12 @@ sub _bidi_pipe {
 
        my @cmd = (qw(git), "--git-dir=$self->{git_dir}",
                        qw(-c core.abbrev=40 cat-file), $batch);
-       my $redir = { 0 => fileno($out_r), 1 => fileno($in_w) };
+       my $redir = { 0 => $out_r, 1 => $in_w };
        if ($err) {
                my $id = "git.$self->{git_dir}$batch.err";
                my $fh = tmpfile($id) or fail($self, "tmpfile($id): $!");
                $self->{$err} = $fh;
-               $redir->{2} = fileno($fh);
+               $redir->{2} = $fh;
        }
        my $p = spawn(\@cmd, undef, $redir);
        defined $p or fail($self, "spawn failed: $!");