[Xfce4-commits] <xfce-git-hooks:master> make sure GIT_DIR is valid, and generate and export REPO
Brian J. Tarricone
brian at tarricone.org
Wed Aug 12 21:28:06 CEST 2009
Updating branch refs/heads/master
to 70f2af8408446d40f1e64372a718c98acab9e1c2 (commit)
from 018e0ff38f5d4df58a874ef0ff122c3131a751ff (commit)
commit 70f2af8408446d40f1e64372a718c98acab9e1c2
Author: Brian J. Tarricone <brian at tarricone.org>
Date: Mon Aug 10 15:22:44 2009 -0700
make sure GIT_DIR is valid, and generate and export REPO
update | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/update b/update
index 2e0053f..e0b7603 100755
--- a/update
+++ b/update
@@ -21,6 +21,16 @@
XFCE_GIT_HOOK_DIR="/usr/local/share/xfce-git-hooks"
+if [ -z "$GIT_DIR" ]; then
+ echo "GIT_DIR is unset!" >&2
+ exit 1
+fi
+
+[[ "$GIT_DIR" = "." ]] && path="`pwd`" || path="$GIT_DIR"
+parent="`dirname $path`"
+export REPO="`basename $parent`/`basename $path`"
+unset parent path
+
$XFCE_GIT_HOOK_DIR/hooks/update-01-block-commits-to-tags "$@" &&
$XFCE_GIT_HOOK_DIR/hooks/update-02-check-permissions "$@" &&
$XFCE_GIT_HOOK_DIR/hooks/update-03-send-commit-mails "$@"
More information about the Xfce4-commits
mailing list