Skip to content

ratchetFrom broken when using git worktrees #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
devinrsmith opened this issue Aug 25, 2021 · 1 comment
Closed

ratchetFrom broken when using git worktrees #920

devinrsmith opened this issue Aug 25, 2021 · 1 comment

Comments

@devinrsmith
Copy link

A colleague of mine, @nbauernfeind, ran into an issue running ./gradlew spotlessApply. After a bit of debugging, we isolated it to using ratchetFrom in combination with a git worktree. It's a relatively easy issue to workaround (just use a plain git clone instead of worktree); but posting here in case anybody else runs into it until it can be fixed.

Caused by: java.lang.IllegalArgumentException: Cannot find git repository in any parent directory
        at com.diffplug.spotless.extra.GitRatchet.repositoryFor(GitRatchet.java:156)
        at com.diffplug.spotless.extra.GitRatchet.repositoryFor(GitRatchet.java:161)
        at com.diffplug.spotless.extra.GitRatchet.repositoryFor(GitRatchet.java:161)
        at com.diffplug.spotless.extra.GitRatchet.rootTreeShaOf(GitRatchet.java:226)
        at com.diffplug.gradle.spotless.SpotlessTask.setupRatchet(SpotlessTask.java:91)
        at com.diffplug.gradle.spotless.FormatExtension.setupTask(FormatExtension.java:733)
        at com.diffplug.gradle.spotless.JavaExtension.setupTask(JavaExtension.java:164)
        at com.diffplug.gradle.spotless.SpotlessExtensionImpl.lambda$createFormatTasks$6(SpotlessExtensionImpl.java:84)

Version: 5.14.2

@nedtwigg
Copy link
Member

Dupe of #75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants