Skip to content

Commit

Permalink
Merge pull request #134 from jonesbusy/bugfix/jgit-not-closed
Browse files Browse the repository at this point in the history
Fix jgit not closed during clone
  • Loading branch information
gounthar authored Jul 30, 2024
2 parents 1745b8e + 189af9b commit 1d69e1d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@ private void fetchRepository(Path pluginDirectory, String repoName, String plugi
String uri = "https://github.com/" + config.getGithubOwner() + "/" + repoName + ".git";
if (!Files.exists(pluginDirectory) || !Files.isDirectory(pluginDirectory)) {
LOG.debug("Cloning {}", pluginName);
Git.cloneRepository()
try (Git git = Git.cloneRepository()
.setURI(uri)
.setDirectory(pluginDirectory.toFile())
.call();
LOG.debug("Cloned successfully from {}", uri);
.call()) {
LOG.debug("Cloned successfully from {}", uri);
}
} else {
// TODO: Cleanup and fetch latest changes. Also ensure on the main branch

Check warning on line 145 in plugin-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/github/GHService.java

View check run for this annotation

ci.jenkins.io / Open Tasks Scanner

TODO

NORMAL: Cleanup and fetch latest changes. Also ensure on the main branch
}
Expand Down

0 comments on commit 1d69e1d

Please sign in to comment.