about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-03-10 21:41:30 +0000
committerEric Wong <e@80x24.org>2024-03-10 21:36:15 +0000
commit1c95e02e19ffc61611dbbfafe64eb13500b44b96 (patch)
tree9cd5b7f2316e38b45c295aa5a51d84cb2fe545e2 /lib
parent58bcb92af35425daa6e809712b7c4aa8d7cbe011 (diff)
downloadpublic-inbox-1c95e02e19ffc61611dbbfafe64eb13500b44b96.tar.gz
We must chomp the newline in the branch name if it's set.

Reported-by: Rob Herring <robh@kernel.org>
Link: https://public-inbox.org/meta/CAL_JsqK7P4gjLPyvzxNEcYmxT4j6Ah5f3Pz1RqDHxmysTg3aEg@mail.gmail.com/
Fixes: 73830410e4336b77 (treewide: use run_qx where appropriate, 2023-10-27)
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Import.pm1
1 files changed, 1 insertions, 0 deletions
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";
         }
 }