aboutsummaryrefslogtreecommitdiffstats
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2019-05-14 21:36:33 -0400
committerJunio C Hamano <gitster@pobox.com>2019-05-15 14:20:01 +0900
commitabd0f289839f6029983a83707f43029c4a2ebf07 (patch)
tree1fee51ddd57a424d843809ab2b4413cf8b69af33 /t/test-lib.sh
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
downloadgit-abd0f289839f6029983a83707f43029c4a2ebf07.tar.gz
test-lib: try harder to ensure a working jgit
The JGIT prereq uses `type jgit` to determine whether jgit is present. While this is usually sufficient, it won't help if the jgit found is badly broken. This wastes time running tests which fail due to no fault of our own. Use `jgit --version` instead, to guard against cases where jgit is present on the system, but will fail to run, e.g. because of some JRE issue, or missing Java dependencies. Checking that it gets far enough to process the '--version' argument isn't perfect, but seems to be good enough in practice. It's also consistent with how we detect some other dependencies, see e.g. the CURL and UNZIP prerequisites. Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 8665b0a9b6..044f271bef 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1476,7 +1476,7 @@ test_lazy_prereq NOT_ROOT '
'
test_lazy_prereq JGIT '
- type jgit
+ jgit --version
'
# SANITY is about "can you correctly predict what the filesystem would