about summary refs log tree commit homepage
path: root/t/solver_git.t
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 /t/solver_git.t
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 't/solver_git.t')
-rw-r--r--t/solver_git.t12
1 files changed, 4 insertions, 8 deletions
diff --git a/t/solver_git.t b/t/solver_git.t
index 4f09e05b..ab8aba15 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -6,7 +6,7 @@ use PublicInbox::TestCommon;
 use Cwd qw(abs_path);
 require_git v2.6;
 use PublicInbox::ContentHash qw(git_sha);
-use PublicInbox::Spawn qw(popen_rd);
+use PublicInbox::Spawn qw(run_qx);
 require_mods(qw(DBD::SQLite Xapian URI::Escape));
 require PublicInbox::SolverGit;
 my $rdr = { 2 => \(my $null) };
@@ -234,13 +234,9 @@ SKIP: {
                 my $cmd = [ qw(git hash-object -w --stdin) ];
                 my $env = { GIT_DIR => $binfoo };
                 while (my ($label, $size) = each %bin) {
-                        pipe(my ($rin, $win)) or BAIL_OUT;
-                        my $rout = popen_rd($cmd , $env, { 0 => $rin });
-                        $rin = undef;
-                        print { $win } ("\0" x $size) or BAIL_OUT;
-                        close $win or BAIL_OUT;
-                        chomp(my $x = <$rout>);
-                        close $rout or BAIL_OUT "$?";
+                        my $rdr = { 0 => \("\0" x $size) };
+                        chomp(my $x = run_qx($cmd , $env, $rdr));
+                        xbail "@$cmd: \$?=$?" if $?;
                         $oid{$label} = $x;
                 }