just use HEAD when tagging

This commit is contained in:
Jakub Sokołowski 2018-05-07 14:46:19 +02:00 committed by Jakub Sokołowski
parent 99e9316fda
commit 6aa2edd2b5
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ getNumber () {
REGEX='^build-[0-9]\+$'
# check if current commit has a build tag
BUILD=$(git tag --points-at refs/tags/HEAD | grep -e "$REGEX")
BUILD=$(git tag --points-at HEAD | grep -e "$REGEX")
# chech for multiple lines
if [ 1 -lt $(echo "$BUILD" | grep -c -) ]; then
@ -49,9 +49,9 @@ BUILD_NO=$(getNumber "$BUILD")
BUILD_NO="$((BUILD_NO+1))"
if [ "$1" = "--tag" ]; then
echo "Tagging refs/tags/HEAD: $BUILD" >&2
echo "Tagging HEAD: $BUILD" >&2
echo "You will need to 'git push --tags' to make this tag take effect." >&2
git tag "build-$BUILD_NO" refs/tags/HEAD
git tag "build-$BUILD_NO" HEAD
fi
# finally print build number