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 9B0921F87C 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=N7Rf9nzKM4i8yoPgXueoUvjgAdYeQgk6qggXsEJIeu8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EUwH4iF9fxanhdEUENFcwxE1JJZEjJVpZzOeMg3TqyI3Zo+T2GqIE5THqo9ovw+zp ClEySX7rkmedaLLBNljdYYdAzquLYEPfso38DTPI1A570ki7ZzYOJMnDMJoxaBLevk craFSb8eTWdzvYz9zvkw444YV5zFgIIVFnTPIXK4= From: Eric Wong To: spew@80x24.org Subject: [PATCH 11/18] admin: run_qx Date: Fri, 27 Oct 2023 09:40:32 +0000 Message-ID: <20231027094039.3788289-11-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/Admin.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm index 3140afad..893f4a1b 100644 --- a/lib/PublicInbox/Admin.pm +++ b/lib/PublicInbox/Admin.pm @@ -9,7 +9,7 @@ use parent qw(Exporter); our @EXPORT_OK = qw(setup_signals); use PublicInbox::Config; use PublicInbox::Inbox; -use PublicInbox::Spawn qw(popen_rd); +use PublicInbox::Spawn qw(run_qx); use PublicInbox::Eml; *rel2abs_collapsed = \&PublicInbox::Config::rel2abs_collapsed; @@ -67,9 +67,8 @@ sub resolve_git_dir { my ($cd) = @_; # try v1 bare git dirs my $cmd = [ qw(git rev-parse --git-dir) ]; - my $fh = popen_rd($cmd, undef, {-C => $cd}); - my $dir = do { local $/; <$fh> }; - close $fh or die "error in @$cmd (cwd:${\($cd // '.')}): $?\n"; + my $dir = run_qx($cmd, undef, {-C => $cd}); + die "error in @$cmd (cwd:${\($cd // '.')}): $?\n" if $?; chomp $dir; # --absolute-git-dir requires git v2.13.0+ $dir = rel2abs_collapsed($dir, $cd) if $dir !~ m!\A/!;