`ratchetFrom` doesn't support merge conflicts
- Dominant language
- Java
- Stars
- 5.6k
- Forks
- 559
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 34
Description
This is an edge case.
I consider a local repository, during a merge conflict. I end with some files being removed locally, but in conflict with the remote head: during the conflict-management process, I end with something like:
```
cleanthat git status
On branch IntroduceSpotLess
Your branch is up to date with 'origin/IntroduceSpotLess'.
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths:
(use "git add/rm ..." as appropriate to mark resolution)
deleted by us: java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: java/src/test/java/eu/solven/cleanthat/language/java/refactorer/test/ARefactorerCases.java
modified: java/src/test/java/eu/solven/cleanthat/language/java/refactorer/test/ATestCases.java
```
Here, `I'm moving java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java` into `java/src/test/java/eu/solven/cleanthat/language/java/refactorer/test/ARefactorerCases.java`
I end with an issue like:
```
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.30.0:apply (applySpotless) on project java: Unable to format file /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.30.0:apply (applySpotless) on project java: Unable to format file /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to format file /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java
at com.diffplug.spotless.maven.SpotlessApplyMojo.process (SpotlessApplyMojo.java:51)
at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:214)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
...
Caused by: java.nio.file.NoSuchFileException: /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java
at sun.nio.fs.UnixException.translateToIOException (UnixException.java:92)
at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111)
at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:116)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel (UnixFileSystemProvider.java:219)
at java.nio.file.Files.newByteChannel (Files.java:370)
at java.nio.file.Files.newByteChannel (Files.java:421)
at java.nio.file.Files.readAllBytes (Files.java:3205)
at com.diffplug.spotless.PaddedCell.calculateDirtyState (PaddedCell.java:189)
at com.diffplug.spotless.maven.SpotlessApplyMojo.process (SpotlessApplyMojo.java:45)
at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:214)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
...
```
where we try to clean a file whicle it does not exists.
I suppose it relates with the `ratchetFrom` feature (which is set to `origin/main `in my configuration).
Contributor guide
Assessment
This issue has not been assessed yet.