From: Jeff King Date: Wed, 6 Feb 2008 10:11:53 +0000 (-0500) Subject: fix config reading in tests X-Git-Tag: v1.5.5-rc0~210^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8bfa6bd6473b086ab2c5781daa08a7b5417c3d1f;p=git.git fix config reading in tests Previously, we set the GIT_CONFIG environment variable in our tests so that only that file was read. However, setting it to a static value is not correct, since we are not necessarily always in the same directory; instead, we want the usual git config file lookup to happen. To do this, we stop setting GIT_CONFIG, which means that we must now suppress the reading of the system-wide and user configs. This exposes an incorrect test in t1500, which is also fixed (the incorrect test worked because we were failing to read the core.bare value from the config file, since the GIT_CONFIG variable was pointing us to the wrong file). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh index e474b3f1d..38a2bf09a 100755 --- a/t/t1500-rev-parse.sh +++ b/t/t1500-rev-parse.sh @@ -33,9 +33,9 @@ test_rev_parse() { test_rev_parse toplevel false false true '' cd .git || exit 1 -test_rev_parse .git/ true true false '' +test_rev_parse .git/ false true false '' cd objects || exit 1 -test_rev_parse .git/objects/ true true false '' +test_rev_parse .git/objects/ false true false '' cd ../.. || exit 1 mkdir -p sub/dir || exit 1 diff --git a/t/test-lib.sh b/t/test-lib.sh index da47bd7c9..83889c4f4 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -324,8 +324,11 @@ test_done () { PATH=$(pwd)/..:$PATH GIT_EXEC_PATH=$(pwd)/.. GIT_TEMPLATE_DIR=$(pwd)/../templates/blt -GIT_CONFIG=.git/config -export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG +unset GIT_CONFIG +unset GIT_CONFIG_LOCAL +GIT_CONFIG_NOSYSTEM=1 +GIT_CONFIG_NOGLOBAL=1 +export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git export GITPERLLIB