diff options
author | Eric Wong <e@yhbt.net> | 2020-01-10 09:14:19 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-01-11 06:32:08 +0000 |
commit | 9f5a583694396f84056b9d92255bba0197b52bc8 (patch) | |
tree | efece7a24babf0bfa9ad0f31abab5a119ce384ff /lib/PublicInbox/Git.pm | |
parent | 6d576feb27625abc36675b7b466265d4f06b2f26 (diff) | |
download | public-inbox-9f5a583694396f84056b9d92255bba0197b52bc8.tar.gz |
Most spawn and popen_rd callers die on failure to spawn, anyways, and some are missing checks entirely. This saves us a bunch of verbose error-checking code in callers. This also makes popen_rd more consistent, since it already dies on pipe creation failures.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r-- | lib/PublicInbox/Git.pm | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index f3b7a0a0..8ee04e17 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -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 $/; @@ -347,7 +345,6 @@ 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>) { |