Skip to content
Draft
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
10 changes: 4 additions & 6 deletions src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
import org.eclipse.jgit.submodule.SubmoduleWalk;
import org.eclipse.jgit.transport.CredentialsProvider;
import org.eclipse.jgit.transport.FetchConnection;
import org.eclipse.jgit.transport.HttpTransport;
import org.eclipse.jgit.transport.PushResult;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.RemoteConfig;
Expand Down Expand Up @@ -993,9 +992,8 @@ private TransportConfigCallback getTransportConfigCallback() {
if (transport instanceof SshTransport sshTransport) {
sshTransport.setSshSessionFactory(buildSshdSessionFactory(this.hostKeyVerifierFactory));
}
if (transport instanceof HttpTransport) {
((TransportHttp) transport)
.setHttpConnectionFactory(new PreemptiveAuthHttpClientConnectionFactory(getProvider()));
if (transport instanceof TransportHttp transportHttp) {
transportHttp.setHttpConnectionFactory(new PreemptiveAuthHttpClientConnectionFactory(getProvider()));
}
};
}
Expand All @@ -1004,8 +1002,8 @@ private void decorateTransport(Transport tn) {
if (tn instanceof SshTransport transport) {
transport.setSshSessionFactory(buildSshdSessionFactory(getHostKeyFactory()));
}
if (tn instanceof HttpTransport) {
((TransportHttp) tn).setHttpConnectionFactory(new PreemptiveAuthHttpClientConnectionFactory(getProvider()));
if (tn instanceof TransportHttp transportHttp) {
transportHttp.setHttpConnectionFactory(new PreemptiveAuthHttpClientConnectionFactory(getProvider()));
}
}

Expand Down