-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
license-maven-plugin-git fails when using git worktree #158
Comments
please provide a way to reproduce the issue or unit test or even a PR to fix that. |
To reproduce:
Stack Traces (click to expand)
|
I believe this is an upstream JGit bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475 |
I wasn't able to reproduce, but I've updated jGit (#231). |
@mathieucarbou Thanks for updating jGit. But, it looks like this isn't fixed upstream yet. I have verified that this remains a problem, up through 4.2.rc1. Here's a way you can reproduce using this (license-maven-plugin) repo:
--- license-maven-plugin/pom.xml
+++ license-maven-plugin/pom.xml
@@ -239,6 +239,13 @@ limitations under the License.
<exclude>docs/**</exclude>
</excludes>
</configuration>
+ <dependencies>
+ <dependency>
+ <groupId>com.mycila</groupId>
+ <artifactId>license-maven-plugin-git</artifactId>
+ <version>4.2.rc1</version>
+ </dependency>
+ </dependencies>
</plugin>
</plugins>
</build>
git checkout -b reproduce-158
git add pom.xml
git commit -m "test commit to reproduce issue 158"
mvn clean license:check
git restore -- docs/
git checkout master
git worktree add ../reproduce-158 reproduce-158
cd ../reproduce-158
mvn clean license:check Because this is still a problem, I think this issue should be re-opened. There may still be a way to work around the upstream bug, by changing how jGit is used in this project, but I haven't tried yet. |
git worktree
allows you to check out a branch in a separate directory, so you can have multiple checked out into separate working directories from a single clone at the same time. The license-maven-plugin-git code seems to be trying to check for a folder at the root, called.git/
. However, when usinggit worktree
, this is a file that references the main checkout directory, rather than a directory.The plugin should be able to handle this case, instead of failing.
The problem might be with the version of jgit being used, and updating the dependency may fix the issue. It's not clear to me, as I'm not that familiar with jgit, or this library's code.
The text was updated successfully, but these errors were encountered: