Commit b7996505 authored by Vitaly Lipatov's avatar Vitaly Lipatov

git: introduce get_last_tag func

parent b31bad93
...@@ -100,11 +100,16 @@ git_commit_ignore_nothing() ...@@ -100,11 +100,16 @@ git_commit_ignore_nothing()
return 1 return 1
} }
get_last_tag()
{
git describe --abbrev=0 --tags
}
# check if tag is last commit tag (put on the last commit). if tag is missed, check with the last tag in repo # 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() is_last_commit_tag()
{ {
local TAG=$1 local TAG=$1
test -n "$TAG" || TAG=$(git describe --abbrev=0 --tags) test -n "$TAG" || TAG=$(get_last_tag)
# check if the tag put on the last commit # check if the tag put on the last commit
[ "$(git rev-parse HEAD)" = "$(git rev-parse $TAG^0)" ] [ "$(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