Skip to content

Commit abd0f28

Browse files
tmzullingergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aeb582a commit abd0f28

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
@@ -1476,7 +1476,7 @@ test_lazy_prereq NOT_ROOT '
14761476
'
14771477

14781478
test_lazy_prereq JGIT '
1479-
type jgit
1479+
jgit --version
14801480
'
14811481

14821482
# SANITY is about "can you correctly predict what the filesystem would

0 commit comments

Comments
 (0)