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

[PATCH 6/9] Cleanup: git-verify-tag-script

From
Junio C Hamano <junkio@cox.net>
Date
Jul 23, 2005, 00:29 UTC
Message-ID
<7vfyu6bc01.fsf@assigned-by-dhcp.cox.net>
From: Eric W. Biederman <ebiederm@xmission.com>
Date: 1121545120 -0600
- Use git-rev-parse to allow sha1 tags references
- When the tag does not verify set an appropriate exit status
- Use git-sh-setup-script to verify the .git directory
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-verify-tag-script |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
c83d38d1dc23f205bb8758fe695b0b4b47601b2e
diff --git a/git-verify-tag-script b/git-verify-tag-script
--- a/git-verify-tag-script
+++ b/git-verify-tag-script
@@ -1,9 +1,8 @@
 #!/bin/sh
-GIT_DIR=${GIT_DIR:-.git}
+. git-sh-setup-script || die "Not a git archive"
 
-tag=$1
-[ -f "$GIT_DIR/refs/tags/$tag" ] && tag=$(cat "$GIT_DIR/refs/tags/$tag")
+tag=$(git-rev-parse $1) || exit 1
 
 git-cat-file tag $tag > .tmp-vtag || exit 1
-cat .tmp-vtag | sed '/-----BEGIN PGP/Q' | gpg --verify .tmp-vtag -
+cat .tmp-vtag | sed '/-----BEGIN PGP/Q' | gpg --verify .tmp-vtag - || exit 1
 rm -f .tmp-vtag
Message 1 of 1 in “Cleanup: git-verify-tag-script”
  1. 6/9 Cleanup: git-verify-tag-scriptJunio C Hamano, Jul 23, 2005

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.