Skip to content

Commit d291a9a

Browse files
committed
Merge branch 'mg/test-installed'
* mg/test-installed: test-lib.sh: Allow running the test suite against installed git test-lib.sh: Test for presence of git-init in the right path.
2 parents c511549 + 6720721 commit d291a9a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

t/test-lib.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ test_create_repo () {
457457
repo="$1"
458458
mkdir -p "$repo"
459459
cd "$repo" || error "Cannot setup test environment"
460-
"$GIT_EXEC_PATH/git" init "--template=$owd/../templates/blt/" >&3 2>&4 ||
460+
"$GIT_EXEC_PATH/git-init" "--template=$owd/../templates/blt/" >&3 2>&4 ||
461461
error "cannot run git init -- have you built things yet?"
462462
mv .git/hooks .git/hooks-disabled
463463
cd "$owd"
@@ -517,8 +517,16 @@ test_done () {
517517
TEST_DIRECTORY=$(pwd)
518518
if test -z "$valgrind"
519519
then
520-
PATH=$TEST_DIRECTORY/..:$PATH
521-
GIT_EXEC_PATH=$TEST_DIRECTORY/..
520+
if test -z "$GIT_TEST_INSTALLED"
521+
then
522+
PATH=$TEST_DIRECTORY/..:$PATH
523+
GIT_EXEC_PATH=$TEST_DIRECTORY/..
524+
else
525+
GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) ||
526+
error "Cannot run git from $GIT_TEST_INSTALLED."
527+
PATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH
528+
GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
529+
fi
522530
else
523531
make_symlink () {
524532
test -h "$2" &&

0 commit comments

Comments
 (0)