|
|
@ -50,6 +50,7 @@ package org.eclipse.jgit.transport; |
|
|
|
import org.eclipse.jgit.errors.TransportException; |
|
|
|
import org.eclipse.jgit.errors.TransportException; |
|
|
|
import org.eclipse.jgit.internal.JGitText; |
|
|
|
import org.eclipse.jgit.internal.JGitText; |
|
|
|
import org.eclipse.jgit.lib.Repository; |
|
|
|
import org.eclipse.jgit.lib.Repository; |
|
|
|
|
|
|
|
import org.eclipse.jgit.util.FS; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* The base class for transports that use SSH protocol. This class allows |
|
|
|
* The base class for transports that use SSH protocol. This class allows |
|
|
@ -80,6 +81,18 @@ public abstract class SshTransport extends TcpTransport { |
|
|
|
sch = SshSessionFactory.getInstance(); |
|
|
|
sch = SshSessionFactory.getInstance(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Create a new transport instance without a local repository. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param uri the URI used to access the remote repository. This must be the |
|
|
|
|
|
|
|
* URI passed to {@link #open(URIish)}. |
|
|
|
|
|
|
|
* @since 3.5 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
protected SshTransport(URIish uri) { |
|
|
|
|
|
|
|
super(uri); |
|
|
|
|
|
|
|
sch = SshSessionFactory.getInstance(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set SSH session factory instead of the default one for this instance of |
|
|
|
* Set SSH session factory instead of the default one for this instance of |
|
|
|
* the transport. |
|
|
|
* the transport. |
|
|
@ -118,8 +131,10 @@ public abstract class SshTransport extends TcpTransport { |
|
|
|
|
|
|
|
|
|
|
|
final int tms = getTimeout() > 0 ? getTimeout() * 1000 : 0; |
|
|
|
final int tms = getTimeout() > 0 ? getTimeout() * 1000 : 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final FS fs = local == null ? FS.detect() : local.getFS(); |
|
|
|
|
|
|
|
|
|
|
|
sock = sch |
|
|
|
sock = sch |
|
|
|
.getSession(uri, getCredentialsProvider(), local.getFS(), tms); |
|
|
|
.getSession(uri, getCredentialsProvider(), fs, tms); |
|
|
|
return sock; |
|
|
|
return sock; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|