maven-scm icon indicating copy to clipboard operation
maven-scm copied to clipboard

JGitUtils.openRepo should return a Git object which closes the wrapped repository

Open kwin opened this issue 5 months ago • 1 comments

Affected version

2.1.0

Bug description

Currently https://github.com/apache/maven-scm/blob/6fc20f710675bd78394633ecaab39a651e89b7cd/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/JGitUtils.java#L97 uses a Git constructor with an explicitly passed repository. That is by default not closed with the wrapper object (but in fact should be). Otherwise the returned Git object cannot be used with try with resource.

kwin avatar Jul 30 '25 18:07 kwin

This is currently blocked by https://github.com/eclipse-jgit/jgit/issues/195.

kwin avatar Aug 01 '25 10:08 kwin