[Xfce4-commits] <xfce-git-hooks:master> Set REPO for post-receive hooks.
Jannis Pohlmann
jannis at xfce.org
Wed Sep 16 19:48:04 CEST 2009
Updating branch refs/heads/master
to 8cc0d1cd2058db5af32a8d3a2318177a508df71b (commit)
from 6cbc03b90d4e65823aaef9bbb03ab48ae9fe7f8f (commit)
commit 8cc0d1cd2058db5af32a8d3a2318177a508df71b
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Wed Sep 16 19:47:22 2009 +0200
Set REPO for post-receive hooks.
post-receive | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/post-receive b/post-receive
index 97104b1..cb15993 100755
--- a/post-receive
+++ b/post-receive
@@ -2,6 +2,18 @@
XFCE_GIT_HOOK_DIR="/usr/local/share/xfce-git-hooks"
+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
+
while read oldrev newrev refname; do
$XFCE_GIT_HOOK_DIR/hooks/post-receive-01-buildbot \
"$oldrev" "$newrev" "$refname"
More information about the Xfce4-commits
mailing list