git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix sample update hook, disable overwriting of existing tags
@ 2009-05-07 16:40 Heiko Voigt
  2009-05-08  0:05 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Voigt @ 2009-05-07 16:40 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Because no special rule for this existed it was allowed by default

Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
---
 templates/hooks--update.sample |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
index f8bf490..68da609 100755
--- a/templates/hooks--update.sample
+++ b/templates/hooks--update.sample
@@ -82,6 +82,12 @@ case "$refname","$newrev_type" in
 		;;
 	refs/tags/*,tag)
 		# annotated tag
+		if [ "$allowdeletetag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
+		then
+			echo "*** Tag '$refname' already exists." >&2
+			echo "*** Overwriting a tag is not allowed in this repository." >&2
+			exit 1
+		fi
 		;;
 	refs/heads/*,commit)
 		# branch
-- 
1.6.2.1.423.g442d

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-08 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-07 16:40 [PATCH] fix sample update hook, disable overwriting of existing tags Heiko Voigt
2009-05-08  0:05 ` Junio C Hamano
2009-05-08 15:22   ` [PATCH v2] Extend sample update hook, disable modifying " Heiko Voigt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).