slachiewicz commented on code in PR #1413:
URL: https://github.com/apache/maven-scm/pull/1413#discussion_r4372128620
##########
maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/JGitUtils.java:
##########
@@ -95,11 +95,14 @@ private JGitUtils() {
* @throws IOException if the repository cannot be opened
*/
public static Git openRepo(File basedir) throws IOException {
- return new Git(new RepositoryBuilder()
+ Repository repository = new RepositoryBuilder()
.readEnvironment()
.findGitDir(basedir)
.setMustExist(true)
- .build());
+ .build();
+ File gitDirectory = repository.getDirectory();
+ repository.close();
Review Comment:
wrap it inside try resouce
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]