From 49288335f73df1dfc830f99a7f568715fafcb8c8 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Mon, 12 Oct 2009 02:16:25 -0400 Subject: [PATCH] Implement update hook for git submodules. svn path=/trunk/scripts/git-hooks/; revision=2499 --- sub/update | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 sub/update diff --git a/sub/update b/sub/update new file mode 100755 index 0000000..11adb92 --- /dev/null +++ b/sub/update @@ -0,0 +1,28 @@ +#!/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 )" >&2 + exit 1 +fi + +if [ -z "$ref" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +# --- Disallow pushing tags + +case "$ref" in + refs/tags/*) + echo "*** Pushing tags to this repository is not allowed" >&2 + exit 1 + ;; +esac -- 1.7.9.5