Check that a tag exists using show-ref instead of looking for the ref file.
authorChristian Couder <chriscool@tuxfamily.org>
Sun, 1 Oct 2006 20:33:04 +0000 (22:33 +0200)
committerJunio C Hamano <junkio@cox.net>
Sun, 1 Oct 2006 22:17:48 +0000 (15:17 -0700)
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-tag.sh

index 6463b314c6fe19c997c2a38d8dfdc1e9bb6637cb..a3f1819b0e96b73c05febdedefdf1652d0ba7f5d 100755 (executable)
@@ -66,7 +66,7 @@ done
 name="$1"
 [ "$name" ] || usage
 prev=0000000000000000000000000000000000000000
-if test -e "$GIT_DIR/refs/tags/$name"
+if git-show-ref --verify --quiet -- "refs/tags/$name"
 then
     test -n "$force" || die "tag '$name' already exists"
     prev=`git rev-parse "refs/tags/$name"`