SonarLint for IntelliJ vs git worktrees

Hi,

Some old discussion mentioned exceptions on SonarLint plugin when working on git worktrees, due to lacking JGIT support for it. As I’m still having similar exceptions (stack below), I was wondering if it’s because the JGIT version hasn’t been upgraded yet, or maybe it’s an unrelated issue?

Thanks

 [2025-02-06T12:21:06.573] [SonarLint Server RPC request executor] WARN sonarlint - Error occurred while reading .gitignore file: 
java.lang.NullPointerException: Cannot invoke "org.eclipse.jgit.lib.AnyObjectId.hashCode()" because "id" is null
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.index(UnpackedObjectCache.java:115)
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.contains(UnpackedObjectCache.java:76)
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache.isUnpacked(UnpackedObjectCache.java:31)
	at org.eclipse.jgit.internal.storage.file.LooseObjects.hasCached(LooseObjects.java:99)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObjectWithoutRestoring(ObjectDirectory.java:359)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:350)
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:133)
	at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:216)
	at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:1144)
	at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:1055)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.readFileContentFromGitRepo(GitUtils.java:198)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.readGitIgnoreFileFromBareRepo(GitUtils.java:171)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.buildIgnoreNode(GitUtils.java:163)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.createSonarLintGitIgnore(GitUtils.java:147)
	at org.sonarsource.sonarlint.core.analysis.AnalysisService.toInputFiles(AnalysisService.java:758)
	at org.sonarsource.sonarlint.core.analysis.AnalysisService.getAnalysisConfigForEngine(AnalysisService.java:278)
	at org.sonarsource.sonarlint.core.analysis.AnalysisService.analyze(AnalysisService.java:646)
	at org.sonarsource.sonarlint.core.rpc.impl.AnalysisRpcServiceDelegate.lambda$analyzeFilesAndTrack$7(AnalysisRpcServiceDelegate.java:131)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$0(AbstractRpcServiceDelegate.java:67)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.computeWithLogger(AbstractRpcServiceDelegate.java:135)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$1(AbstractRpcServiceDelegate.java:65)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Hi,

What version of SonarQube for IntelliJ are you using?

 
Thx,
Ann