Skip to content

Commit ed306e4

Browse files
dschogitster
authored andcommitted
tests: do not require Git to be built when testing an installed Git
We really only need the test helpers to be built in the worktree in that case, but that is not what we test for. On the other hand it is a perfect opportunity to verify that `GIT_TEST_INSTALLED` points to a working Git. So let's test the appropriate Git executable. While at it, also adjust the error message in the `GIT_TEST_INSTALLED` case. This patch is best viewed with `-w --patience`. Helped-by: Jeff King <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 875bf17 commit ed306e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

t/test-lib.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,15 @@ export LSAN_OPTIONS
5151

5252
################################################################
5353
# It appears that people try to run tests without building...
54-
"$GIT_BUILD_DIR/git" >/dev/null
54+
"${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git" >/dev/null
5555
if test $? != 1
5656
then
57-
echo >&2 'error: you do not seem to have built git yet.'
57+
if test -n "$GIT_TEST_INSTALLED"
58+
then
59+
echo >&2 "error: there is no working Git at '$GIT_TEST_INSTALLED'"
60+
else
61+
echo >&2 'error: you do not seem to have built git yet.'
62+
fi
5863
exit 1
5964
fi
6065

0 commit comments

Comments
 (0)