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
11
bin/g
11
bin/g
|
|
@ -476,11 +476,14 @@ then
|
||||||
url=${url%#*}
|
url=${url%#*}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Default to master branch if no branch in URL
|
# Clone specified branch, or default branch if not specified
|
||||||
clone_branch=${clone_branch:-master}
|
if [ -z "$clone_branch" ]; then
|
||||||
|
echo "Cloning default branch of $url"
|
||||||
|
git clone --recurse-submodules "$url"
|
||||||
|
else
|
||||||
echo "Cloning $clone_branch branch of $url"
|
echo "Cloning $clone_branch branch of $url"
|
||||||
git clone --recurse-submodules -b $clone_branch "$url"
|
git clone --recurse-submodules -b "$clone_branch" "$url"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
squash)
|
squash)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue