handle default branch not being called 'master'
This commit is contained in:
parent
2df392e489
commit
048f842376
1 changed files with 8 additions and 5 deletions
13
bin/g
13
bin/g
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue