maven-scm
maven-scm copied to clipboard
JGitUtils.openRepo should return a Git object which closes the wrapped repository
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.
This is currently blocked by https://github.com/eclipse-jgit/jgit/issues/195.