aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2014-05-11 21:27:06 +0200
committerJörg Mayer <jmayer@loplof.de>2014-05-11 19:35:33 +0000
commit03f75ddfeebe41e07adadfba20e0ebe30da95490 (patch)
treeb4c837dd54cb0ef2b6b2c83f60afd7119589b8d9 /tools
parent7a010fa71bc23998d4a6888a280da6ca98c06403 (diff)
It is possible to check out a source tree that is not co-located with
the .git repository. First attempts to support that setup. Change-Id: Ie1560c372e23e58fb0e310f681388b5e1a65ba5b Reviewed-on: https://code.wireshark.org/review/1596 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/pre-commit3
-rw-r--r--tools/test-common.sh2
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/pre-commit b/tools/pre-commit
index 55b9c9c96d..38f6a9b61d 100755
--- a/tools/pre-commit
+++ b/tools/pre-commit
@@ -8,8 +8,9 @@
# http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes
#
+"$GIT_DIR" || GIT_DIR=.git
# Check for newer versions of the pre-commit script
-if [ ./.git/hooks/pre-commit -ot ./tools/pre-commit ] ; then
+if [ ${GIT_DIR}/hooks/pre-commit -ot ./tools/pre-commit ] ; then
echo "Pre-commit hook script is outdated, please update!"
fi
diff --git a/tools/test-common.sh b/tools/test-common.sh
index 1accdc0442..17ac66b57a 100644
--- a/tools/test-common.sh
+++ b/tools/test-common.sh
@@ -152,7 +152,7 @@ function ws_exit_error() {
echo -e "\n" >> $TMP_DIR/${ERR_FILE}.header
- if [ -d .git ] ; then
+ if [ -d ${GIT_DIR:-.git} ] ; then
echo -e "\nGit commit" >> $TMP_DIR/${ERR_FILE}.header
git log -1 >> $TMP_DIR/${ERR_FILE}.header
fi