Skip to content

Commit

Permalink
Bump jgit.version from 7.0.0.202409031743-r to 7.1.0.202411261347-r (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Nov 30, 2024
1 parent 938397e commit 4895aee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<jgit.version>7.0.0.202409031743-r</jgit.version>
<jgit.version>7.1.0.202411261347-r</jgit.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.threshold>Low</spotbugs.threshold>
<spotless.check.skip>false</spotless.check.skip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 4895aee

Please sign in to comment.