Skip to content
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

FileSystemException when executed in not-cloned-to worktree #1047

Closed
5 of 6 tasks
pzygielo opened this issue Dec 24, 2021 · 1 comment
Closed
5 of 6 tasks

FileSystemException when executed in not-cloned-to worktree #1047

pzygielo opened this issue Dec 24, 2021 · 1 comment

Comments

@pzygielo
Copy link
Contributor

pzygielo commented Dec 24, 2021

  • summary of problem
    When build/check is executed in separate worktree (git worktree add ../${project-worktree-dir}) then FileSystemException is reported as ERROR. This however has no impact on the result of the build fortunately.
    This MIGHT be related to 477475, but I guess can also be handled in GitAttributesLineEndings.
  • gradle or maven version
    Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
  • spotless version
    2.18.0
  • operating system and version
    Fedora 35
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace
[INFO] --- spotless-maven-plugin:2.18.0:check (spotless-validation) @ ... ---
...
[ERROR] .../${project-worktree-dir}/.git/config: Not a directory
java.nio.file.FileSystemException: .../${project-worktree-dir}/.git/config: Not a directory
    at sun.nio.fs.UnixException.translateToIOException (UnixException.java:100)
    at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111)
    at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:116)
    at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes (UnixFileAttributeViews.java:55)
    at sun.nio.fs.UnixFileSystemProvider.readAttributes (UnixFileSystemProvider.java:149)
    at sun.nio.fs.LinuxFileSystemProvider.readAttributes (LinuxFileSystemProvider.java:99)
    at java.nio.file.Files.readAttributes (Files.java:1764)
    at org.eclipse.jgit.util.FileUtils.fileAttributes (FileUtils.java:710)
    at org.eclipse.jgit.util.FS.fileAttributes (FS.java:1247)
    at org.eclipse.jgit.internal.storage.file.FileSnapshot.<init> (FileSnapshot.java:230)
    at org.eclipse.jgit.internal.storage.file.FileSnapshot.saveNoConfig (FileSnapshot.java:120)
    at org.eclipse.jgit.storage.file.FileBasedConfig.load (FileBasedConfig.java:125)
    at com.diffplug.common.base.Errors.lambda$wrap$5 (Errors.java:218)
    at com.diffplug.common.base.Errors.run (Errors.java:210)
    at com.diffplug.spotless.extra.GitAttributesLineEndings$RuntimeInit.<init> (GitAttributesLineEndings.java:193)
    at com.diffplug.spotless.extra.GitAttributesLineEndings$RelocatablePolicy.calculateState (GitAttributesLineEndings.java:89)
    at com.diffplug.spotless.extra.GitAttributesLineEndings$RelocatablePolicy.calculateState (GitAttributesLineEndings.java:76)
    at com.diffplug.spotless.LazyForwardingEquality.state (LazyForwardingEquality.java:56)
    at com.diffplug.spotless.LazyForwardingEquality.toBytes (LazyForwardingEquality.java:85)
    at com.diffplug.spotless.LazyForwardingEquality.hashCode (LazyForwardingEquality.java:102)
    at com.diffplug.spotless.Formatter.hashCode (Formatter.java:252)
    at java.util.HashMap.hash (HashMap.java:340)
@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