From: Eric Wong Date: Sat, 15 Feb 2025 11:10:06 +0000 (+0000) Subject: import: clobber $? if global init.defaultBranch fails X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db6faeb69647d8bce821d0b1bf8c849c0bd595e8;p=thirdparty%2Fpublic-inbox.git import: clobber $? if global init.defaultBranch fails 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. --- diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index e6d725fc5..35985f74f 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -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"; } }