Replace the superrepo hooks with an update hook that rejects all
[invirt/scripts/git-hooks.git] / super / update
diff --git a/super/update b/super/update
new file mode 100755 (executable)
index 0000000..1e926e8
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+ref="$1"
+oldrev="$2"
+newrev="$3"
+
+# --- Safety check
+
+if [ -z "$GIT_DIR" ]; then
+        echo "Don't run this script from the command line." >&2
+        echo " (if you want, you could supply GIT_DIR then run" >&2
+        echo "  $0 <ref> <oldrev> <newrev>)" >&2
+        exit 1
+fi
+
+if [ -z "$ref" -o -z "$oldrev" -o -z "$newrev" ]; then
+        echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
+        exit 1
+fi
+
+# --- Disallow all pushes
+
+echo "*** Pushing to the superrepo is not allowed" >&2
+echo "***" >&2
+echo "*** If you would like to update the superrepo, use remctl" >&2
+exit 1