Commit 10e1c2a2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

introduce is_last_commit_tag and use it

parent 6aea7840
......@@ -73,9 +73,8 @@ push_to_remote()
if [ -n "$TAGSALL" ] ; then
docmd git push --tags $GHOST $CURRENTBRANCH
else
local LASTTAG=$(git describe --abbrev=0 --tags)
# check if the last tag put on the last commit
if [ "$(git rev-parse HEAD)" = "$(git rev-parse $LASTTAG^0)" ] ; then
if is_last_commit_tag ; then
local LASTTAG=$(get_last_tag)
echo "*** Push last tag $LASTTAG"
docmd git push $PUSHFORCE $GHOST $LASTTAG
fi
......
......@@ -99,3 +99,13 @@ git_commit_ignore_nothing()
git commit "$@" 2>&1 | grep "nothing to commit" && return 0
return 1
}
# check if tag is last commit tag (put on the last commit). if tag is missed, check with the last tag in repo
is_last_commit_tag()
{
local TAG=$1
test -n "$TAG" || TAG=$(git describe --abbrev=0 --tags)
# check if the tag put on the last commit
[ "$(git rev-parse HEAD)" = "$(git rev-parse $TAG^0)" ]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment