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

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

From
Junio C Hamano <junkio@cox.net>
Date
Oct 3, 2006, 09:09 UTC
Message-ID
<7vlknxrcja.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061001223304.d37df36f.chriscool@tuxfamily.org>

Thanks. We also need this to avoid refetching already packed tags.

-- >8 -- [PATCH] git-fetch: do not look into $GIT_DIR/refs to see if a tag exists.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-fetch.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-fetch.sh b/git-fetch.sh
index f1522bd..e8a7668 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -417,7 +417,7 @@ case "$no_tags$tags" in
 		sed -ne 's|^\([0-9a-f]*\)[ 	]\(refs/tags/.*\)^{}$|\1 \2|p' |
 		while read sha1 name
 		do
-			test -f "$GIT_DIR/$name" && continue
+			git-show-ref --verify --quiet -- $name && continue
 			git-check-ref-format "$name" || {
 				echo >&2 "warning: tag ${name} ignored"
 				continue
-- 
1.4.2.3.gd1e9e
Previous: Christian CouderNext: Christian Couder
Message 2 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.