From: Dmitry Potapov Date: Wed, 25 Jun 2008 08:26:55 +0000 (+0400) Subject: fix update-hook-example to work with packed tag references X-Git-Tag: v1.5.6.1~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/df79b9fdb863648fe27771ac373adb665cab066e fix update-hook-example to work with packed tag references 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 Signed-off-by: Junio C Hamano --- diff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt index 88765b5575..a8d3bae408 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/*)