From 1c95e02e19ffc61611dbbfafe64eb13500b44b96 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Mar 2024 21:41:30 +0000 Subject: import: fix handling of init.defaultBranch We must chomp the newline in the branch name if it's set. Reported-by: Rob Herring Link: https://public-inbox.org/meta/CAL_JsqK7P4gjLPyvzxNEcYmxT4j6Ah5f3Pz1RqDHxmysTg3aEg@mail.gmail.com/ Fixes: 73830410e4336b77 (treewide: use run_qx where appropriate, 2023-10-27) --- lib/PublicInbox/Import.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index a951874b..ed34d548 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -26,6 +26,7 @@ sub default_branch () { state $default_branch = do { my $h = run_qx([qw(git config --global init.defaultBranch)], { GIT_CONFIG => undef }); + chomp $h; $h eq '' ? 'refs/heads/master' : "refs/heads/$h"; } } -- cgit v1.2.3-24-ge0c7