Checkout the proper Git tag when --*-tag={tag} is passed

This commit is contained in:
Anirudha Bose 2014-06-24 11:11:12 +05:30 committed by sftnight
parent 943844f81c
commit 921b60e522

View File

@ -156,6 +156,8 @@ function fetch_cling {
checkout_branch=$(git describe --match v* --abbrev=0 --tags | head -n 1) checkout_branch=$(git describe --match v* --abbrev=0 --tags | head -n 1)
elif [ ${1} = "master" ]; then elif [ ${1} = "master" ]; then
checkout_branch="master" checkout_branch="master"
else
checkout_branch="${1}"
fi fi
git checkout ${checkout_branch} git checkout ${checkout_branch}
@ -169,6 +171,8 @@ function fetch_cling {
checkout_branch=$(git describe --match v* --abbrev=0 --tags | head -n 1) checkout_branch=$(git describe --match v* --abbrev=0 --tags | head -n 1)
elif [ ${1} = "master" ]; then elif [ ${1} = "master" ]; then
checkout_branch="master" checkout_branch="master"
else
checkout_branch="${1}"
fi fi
git checkout ${checkout_branch} git checkout ${checkout_branch}