]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwListing.pm
wwwlisting: do not rely on $? after ProcessPipe::CLOSE
[public-inbox.git] / lib / PublicInbox / WwwListing.pm
index bcb968af9b73c79c2af922b107c7ca1d32342da7..e19ae8a173080160fb026e947b9cd4b2d777e85d 100644 (file)
@@ -127,7 +127,9 @@ sub _json () {
 
 sub fingerprint ($) {
        my ($git) = @_;
-       my $fh = $git->popen('show-ref') or
+       # TODO: convert to qspawn for fairness when there's
+       # thousands of repos
+       my ($fh, $pid) = $git->popen('show-ref') or
                die "popen($git->{git_dir} show-ref) failed: $!";
 
        my $dig = Digest::SHA->new(1);
@@ -135,6 +137,7 @@ sub fingerprint ($) {
                $dig->add($buf);
        }
        close $fh;
+       waitpid($pid, 0);
        return if $?; # empty, uninitialized git repo
        $dig->hexdigest;
 }