diff options
-rwxr-xr-x | update_tags | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/update_tags b/update_tags index 25bc143..31ad8a4 100755 --- a/update_tags +++ b/update_tags @@ -2,8 +2,11 @@ git branch -r | egrep 'tags/(|PR)[0-9]' | sed -e 's"tags/\(.*\)"& v\1"' \ | while read branch tag; do - if [ ! -r .git/refs/tags/$tag ]; then - echo "tagging $tag from $branch" + if ! git show-ref -q "$tag"; then + echo "Tagging $tag from $branch" git tag $tag $branch + elif [ `git show-ref -s $branch` != `git show-ref -s $tag` ]; then + echo "Updating $tag from $branch" + git tag -f $tag $branch fi done |