[X2Go-Commits] [maintenancescripts] 01/03: git/hooks: add common.sh sharing functions and variables for all hooks.

git-admin at x2go.org git-admin at x2go.org
Mon Feb 23 20:42:28 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository maintenancescripts.

commit b19870ee6be0fa641aa35b5c6cfb0f6fa91bf201
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Feb 23 20:36:03 2015 +0100

    git/hooks: add common.sh sharing functions and variables for all hooks.
---
 git/hooks/common.sh |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/git/hooks/common.sh b/git/hooks/common.sh
new file mode 100755
index 0000000..d40f2a7
--- /dev/null
+++ b/git/hooks/common.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [[ "$(git rev-parse --is-bare-directory)" = "true" ]] then
+  GIT_REPO_NAME="$(basename "${PWD}")"
+  OUTSIDE_REPO="/../"
+else
+  GIT_REPO_NAME="$(readlink -nf "${PWD}/..")"
+  OUTSIDE_REPO="/../../"
+fi
+
+# GIT_DIR will always be the current repository's .git dir.
+GIT_DIR="$(pwd)"

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git


More information about the x2go-commits mailing list