[sysadmin-bin: 147/168] Don't allow tags named HEAD, it breaks stuff



commit 2c0bf2bd0afe8089b62cb64324099c9b91ab8540
Author: Jeff Schroeder <jeffschroeder computer org>
Date:   Tue Nov 9 20:27:45 2010 -0800

    Don't allow tags named HEAD, it breaks stuff
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=634426

 pre-receive-check-policy |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pre-receive-check-policy b/pre-receive-check-policy
index a5c3158..16915ed 100755
--- a/pre-receive-check-policy
+++ b/pre-receive-check-policy
@@ -173,6 +173,14 @@ check_ref_update() {
 			    ;;
 			tag)
 			    # Annotated tag
+					if [ "${tagname}" = "HEAD" ]; then
+						cat <<- EOF >&2
+							---
+							You are trying to push a tag named '$tagname'. This is not allowed.
+							---
+							EOF
+						exit 1
+					fi
 			    ;;
 			*)
 			    # git is happy to allow tagging random objects, we aren't



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]