]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Git.pm
git: modified: don't slurp `rev-parse --branches'
[public-inbox.git] / lib / PublicInbox / Git.pm
index 9d0f660bae66a2afe63aef644dee08d38b660565..0ace907e304896728f8c013c29972b9e3308a6d1 100644 (file)
@@ -122,7 +122,6 @@ sub _bidi_pipe {
                $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;
@@ -256,7 +255,6 @@ sub popen {
 sub qx {
        my ($self, @cmd) = @_;
        my $fh = $self->popen(@cmd);
-       defined $fh or return;
        local $/ = "\n";
        return <$fh> if wantarray;
        local $/;
@@ -332,13 +330,6 @@ sub cat_async ($$$;$) {
        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) = @_;
 
@@ -354,10 +345,9 @@ sub 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);
        }