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/Import.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Import.pm') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index fb70b91b..6eee8774 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -8,7 +8,7 @@ package PublicInbox::Import; use v5.12; use parent qw(PublicInbox::Lock); -use PublicInbox::Spawn qw(run_die popen_rd spawn); +use PublicInbox::Spawn qw(run_die run_qx spawn); use PublicInbox::MID qw(mids mid2path); use PublicInbox::Address; use PublicInbox::Smsg; @@ -25,10 +25,8 @@ use PublicInbox::Git qw(read_all); sub default_branch () { state $default_branch = do { - my $r = popen_rd([qw(git config --global init.defaultBranch)], + my $h = run_qx([qw(git config --global init.defaultBranch)], { GIT_CONFIG => undef }); - chomp(my $h = <$r> // ''); - CORE::close $r; $h eq '' ? 'refs/heads/master' : "refs/heads/$h"; } } -- cgit v1.2.3-24-ge0c7