summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2010-09-04 00:29:15 +0300
committerTzafrir Cohen <tzafrir@cohens.org.il>2010-09-04 00:29:15 +0300
commite01ede0d1f2da77f93c5a78409f06321bc7e8d89 (patch)
tree942390afb3554cd354aab6ea6a6aa33f3b8562b4
parent7ba34a926137ee23e8a0df3bcbe4d1a600c8d4b4 (diff)
update_tags: switch to use git show-ref
Don't assume refs sit under .git/refs . Use 'git show-ref' instead.
-rwxr-xr-xupdate_tags7
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