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

[PATCH-maint] test-lib.sh: Help test_create_repo() find the templates dir

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Apr 21, 2009, 09:19 UTC
Message-ID
<1240305543-27163-1-git-send-email-git@drmicha.warpmail.net>
In-Reply-To
<7vocuqbmgu.fsf@gitster.siamese.dyndns.org>

Currently, test_create_repo() expects that templates can be found below $GIT_EXEC_DIR. This assumption fails when tests are run against a git installed somewhere else. Therefore, use $TEST_DIRECTORY as introduced in 2d84e9fb and expect templates to be present in $TEST_DIRECTORY/.. which should be the root dir of the git checkout.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
This is a patch against maint as discussed in
http://article.gmane.org/gmane.comp.version-control.git/11699 although
maint does not (yet) contain a6d63b7 which actually exposes the problem.

The patch does not apply cleanly to master and needs a different commit message there anyways. Therefore, I will send a follow-up with a patch against master. I suggest considering this "maint for master", i.e. applying to master where the bug is actually exposed.

 t/test-lib.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 59d82d2..dbce26a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -434,7 +434,7 @@ test_create_repo () {
 	repo="$1"
 	mkdir -p "$repo"
 	cd "$repo" || error "Cannot setup test environment"
-	"$GIT_EXEC_PATH/git" init "--template=$GIT_EXEC_PATH/templates/blt/" >&3 2>&4 ||
+	"$GIT_EXEC_PATH/git" init "--template=$TEST_DIRECTORY/../templates/blt/" >&3 2>&4 ||
 	error "cannot run git init -- have you built things yet?"
 	mv .git/hooks .git/hooks-disabled
 	cd "$owd"
-- 
1.6.3.rc0.201.g3759d
Previous: Junio C HamanoNext: Michael J Gruber
Message 4 of 7 in “Bug in test-lib.sh: test_create_repo() / RFC”
  1. Michael J GruberApr 20, 2009
  2. Jeff KingApr 21, 2009
  3. Junio C HamanoApr 21, 2009
  4. test-lib.sh: Help test_create_repo() find the templates dirMichael J Gruber, Apr 21, 2009
  5. test-lib.sh: Help test_create_repo() find the templates dirMichael J Gruber, Apr 21, 2009
  6. Johannes SchindelinApr 21, 2009
  7. Michael J GruberApr 21, 2009

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.