Skip to content

Commit 1ae39db

Browse files
authored
Revert "Bump jgit.version from 7.0.0.202409031743-r to 7.1.0.202411261347-r (…" (jenkinsci#1223)
This reverts commit 4895aee.
1 parent ff37e60 commit 1ae39db

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
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.1.0.202411261347-r</jgit.version>
64+
<jgit.version>7.0.0.202409031743-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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import hudson.model.TaskListener;
1515
import hudson.plugins.git.GitObject;
1616
import java.io.File;
17+
import java.io.IOException;
1718
import java.io.PrintWriter;
1819
import java.nio.charset.StandardCharsets;
1920
import java.util.List;
@@ -80,17 +81,21 @@ private void createFile(final String path, final String content) throws Exceptio
8081
}
8182
}
8283

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();
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();
8689
}
8790
}
8891

8992
// No flavor of GitClient has a tag(String) API, only tag(String,String).
9093
// But sometimes we want a lightweight a.k.a. non-annotated tag.
9194
private void lightweightTag(String tagName) throws Exception {
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();
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();
9499
}
95100
}
96101

0 commit comments

Comments
 (0)