diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-06-15 13:50:35 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-06-15 13:50:35 +0100 |
commit | 024a7601f5a1f9507aaa6dd1d8df7394d8e9de36 (patch) | |
tree | 6c437ecd5cc68173e7876d39619c46ee9aa81e27 | |
parent | 31b7b689a287b10d2207db2d3fe75e962b4631c4 (diff) | |
download | jenkinstool-024a7601f5a1f9507aaa6dd1d8df7394d8e9de36.tar.gz |
Recognize releases also from annotated git tags
-rwxr-xr-x | jenkinstool | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/jenkinstool b/jenkinstool index c9655f0..ea70d2b 100755 --- a/jenkinstool +++ b/jenkinstool @@ -108,15 +108,11 @@ is_release() fi elif [ -d .git ] then - tag=$(git show-ref --tags "${project}-${version}" | - awk '{ print $1 }') - commit=$(git log -1 | awk '/^commit / { print $2 }') - if [ -n "$tag" ] && [ "$tag" = "$commit" ] - then - return 0 - else - return 1 - fi + case $(git name-rev --tags --name-only HEAD) in + "${project}-${version}^0") return 0 ;; # annotated tag + "${project}-${version}") return 0 ;; # plain tag + *) return 1 ;; + esac else echo "Unknown version control system" 1>&2 exit 1 |