git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Check that a tag exists using show-ref instead of looking for the ref file.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Oct 1, 2006, 20:33 UTC
Message-ID
<20061001223304.d37df36f.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-tag.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-tag.sh b/git-tag.sh
index 6463b31..a3f1819 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"`
-- 
1.4.2.1.gd567
Next: Junio C Hamano
Message 1 of 4 in “Check that a tag exists using show-ref instead of looking for the ref file.”
  1. Check that a tag exists using show-ref instead of looking for the ref file.Christian Couder, Oct 1, 2006
  2. Junio C HamanoOct 3, 2006
  3. Christian CouderOct 3, 2006
  4. Junio C HamanoOct 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.