apache / apache/maven-scm

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

Open Beginner friendly
#1,274 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
104
Forks
189
Avg merge
17h 46m
Merged PRs (30d)
6

Description

### 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/JGitUtils.java around line 97 and inspect how the Git object is constructed. Verify that the returned object closes the wrapped repository and supports try-with-resources, then run the JGit provider tests to confirm the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.