From e01ede0d1f2da77f93c5a78409f06321bc7e8d89 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sat, 4 Sep 2010 00:29:15 +0300 Subject: update_tags: switch to use git show-ref Don't assume refs sit under .git/refs . Use 'git show-ref' instead. --- update_tags | 7 +++++-- 1 file 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 -- cgit v1.2.3