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

[PATCH 1/2] fix update-hook-example to work with packed tag references

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Jun 25, 2008, 08:26 UTC
Message-ID
<1214382416-6687-1-git-send-email-dpotapov@gmail.com>

The update-hook-example used 'test -f' to check the tag present, which does not work if the checked reference is packed. This check has been changed to use 'git rev-parse $tag' instead.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
---
 Documentation/howto/update-hook-example.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt
index 88765b5..a8d3bae 100644
--- a/Documentation/howto/update-hook-example.txt
+++ b/Documentation/howto/update-hook-example.txt
@@ -68,7 +68,7 @@ function info {
 # - Branches should only be fast-forwarded.
 case "$1" in
   refs/tags/*)
-    [ -f "$GIT_DIR/$1" ] &&
+    git rev-parse --verify -q "$1" &&
     deny >/dev/null "You can't overwrite an existing tag"
     ;;
   refs/heads/*)
-- 
1.5.6
Next: Dmitry Potapov
Message 1 of 4 in “fix update-hook-example to work with packed tag references”
  1. 1/2 fix update-hook-example to work with packed tag referencesDmitry Potapov, Jun 25, 2008
  2. 2/2 update-hook-example: optionally allow non-fast-forwardDmitry Potapov, Jun 25, 2008
  3. Junio C HamanoJun 25, 2008
  4. update-hook-example: optionally allow non-fast-forwardDmitry Potapov, Jun 25, 2008

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.