|Re: [jgit-dev] NPE when calling RepositoryCache.FileKey.isGitRepository on a relative path|
I can reproduce the NPE with a single line:
RepositoryCache.FileKey.isGitRepository(new File("repo.git"), FS.DETECTED)
if the relative path "repo.git" doesn't exist yet.
It's a regression, the previous (File-based, not Path-based) JGit versions
worked fine in this situation.
The problem happens because
evaluates to null in
(The corresponding line is: Path dir = Files.isDirectory(file) ? file :
The documentation doesn't mention whether the path can or cannot be
So I wonder whether this is expected behaviour, and I should use the
absolute path or is it a bug in JGit and it should work with relative paths
Back to the top