Can not open worktrees [message #1802142] |
Fri, 01 February 2019 13:24  |
Eclipse User |
|
|
|
It seems i've tried every combination of FileRepositoryBuilder and Git.open to get access to worktrees but all attempts fail with RepositoryNotFoundException. Is there a generic means of find and opening the repository simply based on PWD?
From within the worktree folder, i've tried every combination between the setGitDir and setWorkTree commented lines:
var repository = FileRepositoryBuilder()
.setMustExist(true)
// .setGitDir(File("."))
// .setGitDir(File("./.git"))
// .setGitDir(File("../parent/.git/worktrees/test"))
// .setWorkTree(File("."))
// .setWorkTree(File("./.git"))
.readEnvironment()
.findGitDir(
.build()
- .setGitDir(File(".") results in java.io.FileNotFoundException: ./config
- .setGitDir(File("./.git") results in RepositoryNotFoundException: repository not found: ./.git though .git does exist. It is the file that points to the ../parent/.git/worktrees/test folder
- .setGitDir(File("../parent/.git/worktrees/test") results in RepositoryNotFoundException: repository not found: ../parent/.git/worktrees/test
- .setWorkTree(File(".") results in RepositoryNotFoundException: repository not found: ../parent/.git/worktrees/test which is interesting that it finds the path to the parent repository but can't open it?
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07913 seconds