diff --git a/pom.xml b/pom.xml index 5d86611389..f95cf26aec 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 2.479 ${jenkins.baseline}.1 - 7.0.0.202409031743-r + 7.1.0.202411261347-r Max Low false diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/JGitLightweightTagTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/JGitLightweightTagTest.java index b234bfee02..f80c35afca 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/JGitLightweightTagTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/JGitLightweightTagTest.java @@ -14,7 +14,6 @@ import hudson.model.TaskListener; import hudson.plugins.git.GitObject; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.nio.charset.StandardCharsets; import java.util.List; @@ -81,21 +80,17 @@ private void createFile(final String path, final String content) throws Exceptio } } - private void packRefs() throws IOException { - try (FileRepository repo = new FileRepository(repoRootGitDir)) { - org.eclipse.jgit.internal.storage.file.GC gc; - gc = new org.eclipse.jgit.internal.storage.file.GC(repo); - gc.packRefs(); + private void packRefs() throws Exception { + try (org.eclipse.jgit.api.Git jgit = new org.eclipse.jgit.api.Git(new FileRepository(repoRootGitDir))) { + jgit.packRefs().setAll(true).call(); } } // No flavor of GitClient has a tag(String) API, only tag(String,String). // But sometimes we want a lightweight a.k.a. non-annotated tag. private void lightweightTag(String tagName) throws Exception { - try (FileRepository repo = new FileRepository(repoRootGitDir)) { - // Collides with implicit org.jenkinsci.plugins.gitclient.Git. - org.eclipse.jgit.api.Git jgitAPI = org.eclipse.jgit.api.Git.wrap(repo); - jgitAPI.tag().setName(tagName).setAnnotated(false).call(); + try (org.eclipse.jgit.api.Git jgit = new org.eclipse.jgit.api.Git(new FileRepository(repoRootGitDir))) { + jgit.tag().setName(tagName).setAnnotated(false).call(); } }