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 <dpotapov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry Potapov committed
Jun 25, 2008 at 12:26 UTC
df79b9fdb863648fe27771ac373adb665cab066e
1 file changed
+1
-1
Documentation/howto/update-hook-example.txt
+1
-1
@@ -68,7 +68,7 @@ function info {
68
# - Branches should only be fast-forwarded.
69
case "$1" in
70
refs/tags/*)
71
- [ -f "$GIT_DIR/$1" ] &&
71
+ git rev-parse --verify -q "$1" &&
72
deny >/dev/null "You can't overwrite an existing tag"
73
;;
74
refs/heads/*)