Skip to content

Commit

Permalink
change how jgit factory are configured as it is static it can be setu…
Browse files Browse the repository at this point in the history
…p only once then use some ThreadLocal for request type operations, a bit fragile but no much choice as jgit is using only some static method

Signed-off-by: Olivier Lamy <[email protected]>
  • Loading branch information
olamy committed Apr 23, 2024
1 parent 2bc1810 commit 7049e95
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 331 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@
<artifactId>mina-sshd-api-core</artifactId>
</dependency>
<!-- this could be optional? -->
<!-- <dependency>-->
<!-- <groupId>net.i2p.crypto</groupId>-->
<!-- <artifactId>eddsa</artifactId>-->
<!-- <version>0.3.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>net.i2p.crypto</groupId>-->
<!-- <artifactId>eddsa</artifactId>-->
<!-- <version>0.3.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
Expand Down

This file was deleted.

5 changes: 1 addition & 4 deletions src/main/java/org/jenkinsci/plugins/gitclient/Git.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.gitclient.jgit.PreemptiveAuthHttpClientConnectionFactory;
import org.jenkinsci.plugins.gitclient.verifier.HostKeyVerifierFactory;
import org.jenkinsci.plugins.gitclient.verifier.NoHostKeyVerificationStrategy;

Expand Down Expand Up @@ -199,9 +198,7 @@ public GitClient invoke(File f, VirtualChannel channel) throws IOException, Inte
}

if (JGitApacheTool.MAGIC_EXENAME.equalsIgnoreCase(exe)) {
final PreemptiveAuthHttpClientConnectionFactory factory =
new PreemptiveAuthHttpClientConnectionFactory();
return new JGitAPIImpl(f, listener, factory, hostKeyFactory);
return new JGitAPIImpl(f, listener, null, hostKeyFactory);
}
// Ensure we return a backward compatible GitAPI, even API only claim to provide a GitClient
GitAPI gitAPI = new GitAPI(exe, f, listener, env);
Expand Down
Loading

0 comments on commit 7049e95

Please sign in to comment.