handle default branch not being called 'master'

This commit is contained in:
William Hilton 2022-08-31 16:38:31 -04:00
parent 2df392e489
commit 048f842376
No known key found for this signature in database
GPG key ID: 9609B8A5928BA6B9

13
bin/g
View file

@ -476,11 +476,14 @@ then
url=${url%#*}
fi
# Default to master branch if no branch in URL
clone_branch=${clone_branch:-master}
echo "Cloning $clone_branch branch of $url"
git clone --recurse-submodules -b $clone_branch "$url"
# Clone specified branch, or default branch if not specified
if [ -z "$clone_branch" ]; then
echo "Cloning default branch of $url"
git clone --recurse-submodules "$url"
else
echo "Cloning $clone_branch branch of $url"
git clone --recurse-submodules -b "$clone_branch" "$url"
fi
;;
squash)