mirror of
https://github.com/git/git
synced 2024-08-26 19:19:18 +00:00
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>
This commit is contained in:
parent
2beebd22f4
commit
df79b9fdb8
|
@ -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/*)
|
||||
|
|
Loading…
Reference in a new issue