$redir->{2} = $fh;
}
my $p = spawn(\@cmd, undef, $redir);
- defined $p or fail($self, "spawn failed: $!");
$self->{$pid} = $p;
$out_w->autoflush(1);
$self->{$out} = $out_w;
sub qx {
my ($self, @cmd) = @_;
my $fh = $self->popen(@cmd);
- defined $fh or return;
local $/ = "\n";
return <$fh> if wantarray;
local $/;
push(@$inflight, [ $cb, $arg ]);
}
-sub commit_title ($$) {
- my ($self, $oid) = @_; # PublicInbox::Git, $sha1hex
- my $buf = cat_file($self, $oid) or return;
- utf8::decode($$buf);
- ($$buf =~ /\r?\n\r?\n([^\r\n]+)\r?\n?/)[0]
-}
-
sub extract_cmt_time {
my ($bref, undef, undef, undef, $modified) = @_;
my ($self) = @_;
my $modified = 0;
my $fh = popen($self, qw(rev-parse --branches));
- defined $fh or return $modified;
cat_async_begin($self);
local $/ = "\n";
- foreach my $oid (<$fh>) {
+ while (my $oid = <$fh>) {
chomp $oid;
cat_async($self, $oid, \&extract_cmt_time, \$modified);
}