[RFC] Support TEST_GIT_PATH variable for the path for the git to test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is useful if you want to see how some other version of git
handles the tests for some reason. (For example, see how a working
version manages to work while a broken one doesn't)

This version only sort of works, but it's enough to have been helpful in 
debugging builtin-clone, and most of what's left I don't really understand 
at all (the perl code, for example).

Signed-off-by: Daniel Barkalow <barkalow@xxxxxxxxxxxx>
---
 t/test-lib.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 83889c4..5300549 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -281,7 +281,8 @@ test_create_repo () {
 	cd "$repo" || error "Cannot setup test environment"
 	"$GIT_EXEC_PATH/git" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
 	error "cannot run git init -- have you built things yet?"
-	mv .git/hooks .git/hooks-disabled
+	[ ! -e .git/hooks ] || mv .git/hooks .git/hooks-disabled
+	[ -e .git/info ] || mkdir .git/info
 	cd "$owd"
 }
 
@@ -321,8 +322,8 @@ test_done () {
 
 # Test the binaries we have just built.  The tests are kept in
 # t/ subdirectory and are run in trash subdirectory.
-PATH=$(pwd)/..:$PATH
-GIT_EXEC_PATH=$(pwd)/..
+GIT_EXEC_PATH=${TEST_GIT_PATH:-$(pwd)/..}
+PATH=$GIT_EXEC_PATH:$(pwd)/..:$PATH
 GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
 unset GIT_CONFIG
 unset GIT_CONFIG_LOCAL
-- 
1.5.4.2.261.g851a5.dirty
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux