Skip to content

Commit

Permalink
fix update-hook-example to work with packed tag references
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Potapov authored and Junio C Hamano committed Jun 25, 2008
1 parent 2beebd2 commit df79b9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/howto/update-hook-example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/*)
Expand Down

0 comments on commit df79b9f

Please sign in to comment.