diff options
author | Eric Wong <e@80x24.org> | 2023-10-27 22:21:13 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-28 09:08:18 +0000 |
commit | 73830410e4336b779c820e90a8604e9e74f38b90 (patch) | |
tree | 92962cefd15d77edb12c57d08cc89b0d37110d67 /lib/PublicInbox/Fetch.pm | |
parent | ef5bd67cbcdcd8cba2cb8b3718ea90afda6b7ebe (diff) | |
download | public-inbox-73830410e4336b779c820e90a8604e9e74f38b90.tar.gz |
This saves us some code, and is a small step towards getting ProcessIO working with stat, fcntl and other perlops that don't work with tied handles.
Diffstat (limited to 'lib/PublicInbox/Fetch.pm')
-rw-r--r-- | lib/PublicInbox/Fetch.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/Fetch.pm b/lib/PublicInbox/Fetch.pm index e41dd448..b0f1437c 100644 --- a/lib/PublicInbox/Fetch.pm +++ b/lib/PublicInbox/Fetch.pm @@ -5,7 +5,7 @@ package PublicInbox::Fetch; use v5.12; use parent qw(PublicInbox::IPC); use URI (); -use PublicInbox::Spawn qw(popen_rd run_wait); +use PublicInbox::Spawn qw(popen_rd run_qx run_wait); use PublicInbox::Admin; use PublicInbox::LEI; use PublicInbox::LeiCurl; @@ -20,9 +20,8 @@ sub remote_url ($$) { my $rn = $lei->{opt}->{'try-remote'} // [ 'origin', '_grokmirror' ]; for my $r (@$rn) { my $cmd = [ qw(git config), "remote.$r.url" ]; - my $fh = popen_rd($cmd, undef, { -C => $dir, 2 => $lei->{2} }); - my $url = <$fh>; - close $fh or next; + my $url = run_qx($cmd, undef, { -C => $dir, 2 => $lei->{2} }); + next if $?; $url =~ s!/*\n!!s; return $url; } |