about summary refs log tree commit homepage
path: root/lib/PublicInbox/Import.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-27 22:21:13 +0000
committerEric Wong <e@80x24.org>2023-10-28 09:08:18 +0000
commit73830410e4336b779c820e90a8604e9e74f38b90 (patch)
tree92962cefd15d77edb12c57d08cc89b0d37110d67 /lib/PublicInbox/Import.pm
parentef5bd67cbcdcd8cba2cb8b3718ea90afda6b7ebe (diff)
downloadpublic-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/Import.pm')
-rw-r--r--lib/PublicInbox/Import.pm6
1 files changed, 2 insertions, 4 deletions
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";
         }
 }