You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a worktree, gradle tasks run into the following error:
java.nio.file.FileSystemException: <worktree directory>/.git/config: Not a directory
at com.palantir.gradle.gitversion.GitVersionPlugin.gitRepo(GitVersionPlugin.java:73)
at com.palantir.gradle.gitversion.GitVersionPlugin.apply(GitVersionPlugin.java:36)
at com.palantir.gradle.gitversion.GitVersionPlugin.apply(GitVersionPlugin.java:29)
Similar for
java.nio.file.FileSystemException: <worktree directory>/.git/refs/HEAD: Not a directory
at com.palantir.gradle.gitversion.VersionDetailsImpl.isRepoEmpty(VersionDetailsImpl.java:102)
at com.palantir.gradle.gitversion.VersionDetailsImpl.expensiveComputeRawDescription(VersionDetailsImpl.java:74)
at com.palantir.gradle.gitversion.VersionDetailsImpl.description(VersionDetailsImpl.java:67)
at com.palantir.gradle.gitversion.VersionDetailsImpl.getVersion(VersionDetailsImpl.java:47)
at com.palantir.gradle.gitversion.VersionDetailsImpl.isRepoEmpty(VersionDetailsImpl.java:102)
at com.palantir.gradle.gitversion.VersionDetailsImpl.expensiveComputeRawDescription(VersionDetailsImpl.java:74)
at com.palantir.gradle.gitversion.VersionDetailsImpl.description(VersionDetailsImpl.java:67)
at com.palantir.gradle.gitversion.VersionDetailsImpl.getVersion(VersionDetailsImpl.java:47)
This seems to assume the .git file in the repo is always a git dir, which is not true for worktrees.
The correct solution is to use the command git rev-parse --git-dir for the worktree-specific git dir, and git rev-parse --git-common-dir for the shared git dir for all worktrees in the checkout.
The text was updated successfully, but these errors were encountered:
I imagine it's related to worktrees as well having .git files with references to the parent .git folder. I was having a hard time with the difference in naming.
When using a worktree, gradle tasks run into the following error:
Similar for
gradle-git-version/src/main/java/com/palantir/gradle/gitversion/GitVersionPlugin.java
Lines 87 to 101 in 26eada3
This seems to assume the
.git
file in the repo is always a git dir, which is not true for worktrees.The correct solution is to use the command
git rev-parse --git-dir
for the worktree-specific git dir, andgit rev-parse --git-common-dir
for the shared git dir for all worktrees in the checkout.The text was updated successfully, but these errors were encountered: