From: Evan Broder Date: Mon, 12 Oct 2009 06:16:25 +0000 (-0400) Subject: Implement update hook for git submodules. X-Git-Url: http://xvm.mit.edu/gitweb/invirt/scripts/git-hooks.git/commitdiff_plain/49288335f73df1dfc830f99a7f568715fafcb8c8?ds=inline Implement update hook for git submodules. svn path=/trunk/scripts/git-hooks/; revision=2499 --- 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