]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: unset GIT_CONFIG with `git config --global'
authorEric Wong <e@80x24.org>
Fri, 1 Jan 2021 05:47:49 +0000 (17:47 -1200)
committerEric Wong <e@80x24.org>
Sat, 2 Jan 2021 09:15:09 +0000 (09:15 +0000)
GIT_CONFIG is set by -convert, and user may have it set
for other reasons.  In either case, it conflicts with
any any attempt to use `git config --global` so we have
to unset it.

This fixes t/multi-mid.t under TEST_RUN_MODE=0

lib/PublicInbox/Import.pm

index 47a529ff6767fee583af0138a907a0b4ca8343d5..0aff0e9dc96e8a21e78c3f99ab34bbc089ef7303 100644 (file)
@@ -21,6 +21,7 @@ use POSIX qw(strftime);
 
 sub default_branch () {
        state $default_branch = do {
+               delete local $ENV{GIT_CONFIG};
                my $r = popen_rd([qw(git config --global init.defaultBranch)]);
                chomp(my $h = <$r> // '');
                $h eq '' ? 'refs/heads/master' : $h;