Skip to content

Commit 4895aee

Browse files
Bump jgit.version from 7.0.0.202409031743-r to 7.1.0.202411261347-r (jenkinsci#1220)
1 parent 938397e commit 4895aee

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
6262
<jenkins.baseline>2.479</jenkins.baseline>
6363
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
64-
<jgit.version>7.0.0.202409031743-r</jgit.version>
64+
<jgit.version>7.1.0.202411261347-r</jgit.version>
6565
<spotbugs.effort>Max</spotbugs.effort>
6666
<spotbugs.threshold>Low</spotbugs.threshold>
6767
<spotless.check.skip>false</spotless.check.skip>

src/test/java/org/jenkinsci/plugins/gitclient/JGitLightweightTagTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import hudson.model.TaskListener;
1515
import hudson.plugins.git.GitObject;
1616
import java.io.File;
17-
import java.io.IOException;
1817
import java.io.PrintWriter;
1918
import java.nio.charset.StandardCharsets;
2019
import java.util.List;
@@ -81,21 +80,17 @@ private void createFile(final String path, final String content) throws Exceptio
8180
}
8281
}
8382

84-
private void packRefs() throws IOException {
85-
try (FileRepository repo = new FileRepository(repoRootGitDir)) {
86-
org.eclipse.jgit.internal.storage.file.GC gc;
87-
gc = new org.eclipse.jgit.internal.storage.file.GC(repo);
88-
gc.packRefs();
83+
private void packRefs() throws Exception {
84+
try (org.eclipse.jgit.api.Git jgit = new org.eclipse.jgit.api.Git(new FileRepository(repoRootGitDir))) {
85+
jgit.packRefs().setAll(true).call();
8986
}
9087
}
9188

9289
// No flavor of GitClient has a tag(String) API, only tag(String,String).
9390
// But sometimes we want a lightweight a.k.a. non-annotated tag.
9491
private void lightweightTag(String tagName) throws Exception {
95-
try (FileRepository repo = new FileRepository(repoRootGitDir)) {
96-
// Collides with implicit org.jenkinsci.plugins.gitclient.Git.
97-
org.eclipse.jgit.api.Git jgitAPI = org.eclipse.jgit.api.Git.wrap(repo);
98-
jgitAPI.tag().setName(tagName).setAnnotated(false).call();
92+
try (org.eclipse.jgit.api.Git jgit = new org.eclipse.jgit.api.Git(new FileRepository(repoRootGitDir))) {
93+
jgit.tag().setName(tagName).setAnnotated(false).call();
9994
}
10095
}
10196

0 commit comments

Comments
 (0)