Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump jgit.version from 7.0.0.202409031743-r to 7.1.0.202411261347-r #1227

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,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
Loading