]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
import: clobber $? if global init.defaultBranch fails
authorEric Wong <e@80x24.org>
Sat, 15 Feb 2025 11:10:06 +0000 (11:10 +0000)
committerEric Wong <e@80x24.org>
Mon, 17 Feb 2025 20:09:07 +0000 (20:09 +0000)
We don't want $? influencing further error checking downstream,
such as thw _wq_done_wait call in public-inbox-clone when
git-config(1) invocations which set $?=0 are replaced with
in-process libgit2 config function calls.

lib/PublicInbox/Import.pm

index e6d725fc5563e9da731e8252bc345f846f86d7fd..35985f74f60cd8b8b3a7fbcb16a3bc7fbd227561 100644 (file)
@@ -29,6 +29,7 @@ sub default_branch () {
                my $h = run_qx([git_exe,qw(config --global init.defaultBranch)],
                                 { GIT_CONFIG => undef });
                chomp $h;
+               $? = 0;
                $h eq '' ? 'refs/heads/master' : "refs/heads/$h";
        }
 }