Skip to content

Commit 3a04832

Browse files
Michael J Grubergitster
authored andcommitted
test-lib.sh: Help test_create_repo() find the templates dir
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 2d84e9f 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0be9bc0 commit 3a04832

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/test-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ test_create_repo () {
491491
repo="$1"
492492
mkdir -p "$repo"
493493
cd "$repo" || error "Cannot setup test environment"
494-
"$GIT_EXEC_PATH/git-init" "--template=$owd/../templates/blt/" >&3 2>&4 ||
494+
"$GIT_EXEC_PATH/git-init" "--template=$TEST_DIRECTORY/../templates/blt/" >&3 2>&4 ||
495495
error "cannot run git init -- have you built things yet?"
496496
mv .git/hooks .git/hooks-disabled
497497
cd "$owd"

0 commit comments

Comments
 (0)