Open
Description
The indra-git plugin fails to discover the containing repository if the gradle project does not reside at the repository root. This is not the case for monorepos, git-subtrees, and other repository structures that contain multiple projects.
From IndraGitService.java:115, it appears that the plugin discovers the repository like this:
final Repository repo = new RepositoryBuilder().setWorkTree(targetDir).setGitDir(realGit).setMustExist(true).build();
The upstream JGit documentation recommends using an approach like this:
new RepositoryBuilder()
.setGitDir(gitDirArgument) // --git-dir if supplied, no-op if null
.readEnviroment() // scan environment GIT_* variables
.findGitDir() // scan up the file system tree
.build()
where findGitDir()
traverses up the filesystem like the git
executable does.
If indra-git performed a filesystem traversal with findGitDir()
, it would probably be compatible with monorepo layouts.
Metadata
Metadata
Assignees
Labels
No labels