From b431b2822f361efcb940adbc1f2097e122e90ed9 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 1 Oct 2006 22:33:04 +0200 Subject: [PATCH] Check that a tag exists using show-ref instead of looking for the ref file. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- git-tag.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-tag.sh b/git-tag.sh index 6463b314c6..a3f1819b0e 100755 --- a/git-tag.sh +++ b/git-tag.sh @@ -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"`