git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 25, 2008, 23:21 UTC
Message-ID
<alpine.LNX.1.00.0802251600220.19024@iabervon.org>

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@iabervon.org>
---
 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
Next: Junio C Hamano
Message 1 of 8 in “[RFC] Support TEST_GIT_PATH variable for the path for the git to test”
  1. Daniel BarkalowFeb 25, 2008
  2. Junio C HamanoFeb 26, 2008
  3. Daniel BarkalowFeb 26, 2008
  4. Junio C HamanoFeb 26, 2008
  5. Daniel BarkalowFeb 26, 2008
  6. Junio C HamanoFeb 26, 2008
  7. Daniel BarkalowFeb 26, 2008
  8. Junio C HamanoFeb 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.