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

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

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Apr 21, 2009, 09:21 UTC
Message-ID
<1240305719-27224-1-git-send-email-git@drmicha.warpmail.net>
In-Reply-To
<1240305543-27163-1-git-send-email-git@drmicha.warpmail.net>

Currently, test_create_repo() expects that templates can be found below `pwd`/.. This assumption fails when tests are run against a git installed somewhere else or test_create_repo() is called from subdirectiories (several tests do this). 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>
---
 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 4bd986f..dad1437 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -491,7 +491,7 @@ test_create_repo () {
 	repo="$1"
 	mkdir -p "$repo"
 	cd "$repo" || error "Cannot setup test environment"
-	"$GIT_EXEC_PATH/git-init" "--template=$owd/../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: Michael J GruberNext: Johannes Schindelin
Message 5 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.