From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2C0E11F723 for ; Fri, 27 Oct 2023 09:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1698399641; bh=yZlw/atMgCxrMuI92drqqD96qg4wgAv96fjp2awnXqg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OBbZVj1v7wLyV/fEpXWQmJhnJPnq1USIr8hdmgmhEr5KkBK421Kpx6+EZhMdk3rH2 V09yY/S59Wp7Ft9DBYJQS4mWFflpOb7uEQDKBxaxziRSFmuJ2IGE/4qs3GinktqR/b pafx3IGlcDU0JqJSSb3/xAhzNMP7HmyRiFfuU+Lw= From: Eric Wong To: spew@80x24.org Subject: [PATCH 08/18] fetch: use run_qx Date: Fri, 27 Oct 2023 09:40:29 +0000 Message-ID: <20231027094039.3788289-8-e@80x24.org> In-Reply-To: <20231027094039.3788289-1-e@80x24.org> References: <20231027094039.3788289-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- lib/PublicInbox/Fetch.pm | 7 +++---- 1 file 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; }