about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-27 06:02:47 +0000
committerEric Wong <e@80x24.org>2023-09-28 02:34:56 +0000
commit3cea12e29643a02bc9d33802896d3dd12c8bc8fa (patch)
tree04724873e9bd01fb27011c23768c83b3bf1bc31c /script
parent72ccceeb02542dda09b8a641c2bd17dd74440cc2 (diff)
downloadpublic-inbox-3cea12e29643a02bc9d33802896d3dd12c8bc8fa.tar.gz
ProcessPipe->CLOSE will already run waitpid for us and
exit on errors, so we can do less, here.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-convert6
1 files changed, 2 insertions, 4 deletions
diff --git a/script/public-inbox-convert b/script/public-inbox-convert
index 96931cbf..780f7194 100755
--- a/script/public-inbox-convert
+++ b/script/public-inbox-convert
@@ -117,7 +117,7 @@ $clone may not be valid after migrating to v2, not copying
 }
 my $state = '';
 my $head = $old->{ref_head} || 'HEAD';
-my ($rd, $pid) = $old->git->popen(qw(fast-export --use-done-feature), $head);
+my $rd = $old->git->popen(qw(fast-export --use-done-feature), $head);
 $v2w->idx_init($opt);
 my $im = $v2w->importer;
 my ($r, $w) = $im->gfi_start;
@@ -164,9 +164,7 @@ while (<$rd>) {
         last if $_ eq "done\n";
         print $w $_ or $im->wfail;
 }
-close $rd or die "close fast-export: $!\n";
-waitpid($pid, 0) or die "waitpid failed: $!\n";
-$? == 0 or die "fast-export failed: $?\n";
+close $rd or die "fast-export: \$?=$? \$!=$!\n";
 $r = $w = undef; # v2w->done does the actual close and error checking
 $v2w->done;
 if (my $old_mm = $old->mm) {