]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/test-lib.sh
Merge branch 'master' of git://repo.or.cz/git-gui
[git.git] / t / test-lib.sh
old mode 100755 (executable)
new mode 100644 (file)
index 37822fc..dee3ad7
@@ -16,6 +16,7 @@ unset AUTHOR_EMAIL
 unset AUTHOR_NAME
 unset COMMIT_AUTHOR_EMAIL
 unset COMMIT_AUTHOR_NAME
+unset EMAIL
 unset GIT_ALTERNATE_OBJECT_DIRECTORIES
 unset GIT_AUTHOR_DATE
 GIT_AUTHOR_EMAIL=author@example.com
@@ -36,6 +37,10 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
 export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
 export EDITOR VISUAL
 
+# Protect ourselves from common misconfiguration to export
+# CDPATH into the environment
+unset CDPATH
+
 case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
        1|2|true)
                echo "* warning: Some tests will not work if GIT_TRACE" \
@@ -255,8 +260,8 @@ test_done () {
 PATH=$(pwd)/..:$PATH
 GIT_EXEC_PATH=$(pwd)/..
 GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
-HOME=$(pwd)/trash
-export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR HOME
+GIT_CONFIG=.git/config
+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG
 
 GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
 export GITPERLLIB
@@ -264,6 +269,12 @@ test -d ../templates/blt || {
        error "You haven't built things yet, have you?"
 }
 
+if ! test -x ../test-chmtime; then
+       echo >&2 'You need to build test-chmtime:'
+       echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
+       exit 1
+fi
+
 # Test repository
 test=trash
 rm -fr "$test"