This might improve grep-ability slightly and reduce allocations
while we're at it.
my ($self) = @_;
return if $self->{pid};
my ($in, $out);
- my $pid = open2($in, $out, 'git', '--git-dir', $self->{git_dir},
- 'cat-file', '--batch');
+ my $pid = open2($in, $out, 'git', "--git-dir=$self->{git_dir}",
+ qw(cat-file --batch));
$self->{pid} = $pid;
$self->{in} = $in;
require IPC::Run;
my ($in, $blob, $err);
open my $null, '+<', '/dev/null' or die "open: $!\n";
- IPC::Run::run(['git', '--git-dir', $ctx->{git_dir},
+ IPC::Run::run(['git', "--git-dir=$ctx->{git_dir}",
qw(cat-file blob), "HEAD:$1/$2"],
$null, \$blob, $null);
$? == 0 ? \$blob : undef;