From 73830410e4336b779c820e90a8604e9e74f38b90 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Oct 2023 22:21:13 +0000 Subject: treewide: use run_qx where appropriate 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. --- lib/PublicInbox/Fetch.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Fetch.pm') 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; } -- cgit v1.2.3-24-ge0c7