]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: reap git-config(1) synchronously
authorEric Wong <e@80x24.org>
Mon, 1 Feb 2021 08:28:29 +0000 (22:28 -1000)
committerEric Wong <e@80x24.org>
Mon, 1 Feb 2021 11:38:23 +0000 (11:38 +0000)
This avoids a zombie if another step of the event loop
takes too long.

lib/PublicInbox/Import.pm

index 8a06a661654b861975efbd88cc0df7fdcb010122..a070aa1e9be0f6969d09eb1111fd5494b8320b5b 100644 (file)
@@ -24,6 +24,7 @@ sub default_branch () {
                delete local $ENV{GIT_CONFIG};
                my $r = popen_rd([qw(git config --global init.defaultBranch)]);
                chomp(my $h = <$r> // '');
+               close $r;
                $h eq '' ? 'refs/heads/master' : $h;
        }
 }