aboutsummaryrefslogtreecommitdiff
path: root/pre-receive
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-11-24 02:02:28 -0500
committerB. Watson <urchlay@slackware.uk>2026-11-24 02:02:28 -0500
commitf266383c328bd25439179f696be7efa5424fcc25 (patch)
treee8c8f8f7c0777c16fe6537603d218aed519cc9e9 /pre-receive
parent616e10be3af507a747de3e288c4b2a18191ffb9e (diff)
downloadsbo-maintainer-tools-f266383c328bd25439179f696be7efa5424fcc25.tar.gz
pre-receive: handle case where "git config get init.defaultBranch" returns nothing.
Diffstat (limited to 'pre-receive')
-rwxr-xr-xpre-receive4
1 files changed, 4 insertions, 0 deletions
diff --git a/pre-receive b/pre-receive
index 4cba932..e2533da 100755
--- a/pre-receive
+++ b/pre-receive
@@ -225,6 +225,10 @@ sub read_push_options {
sub set_default_branch {
chomp ($default_branch = `git config get init.defaultBranch`);
+ if(!length($default_branch)) {
+ debug("got empty result from 'git config get init.defaultBranch', assuming 'master'");
+ $default_branch = "master";
+ }
debug("default branch is '$default_branch'");
}