Class TransportGitSsh
- All Implemented Interfaces:
AutoCloseable
,PackTransport
The SSH transport requires the remote side to have Git installed, as the transport logs into the remote system and executes a Git helper program on the remote side to read (or write) the remote repository's files.
This transport does not support direct SCP style of copying files, as it assumes there are Git specific smarts on the remote side to perform object enumeration, save file modification and hook execution.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
(package private) class
(package private) class
Nested classes/interfaces inherited from class org.eclipse.jgit.transport.Transport
Transport.Operation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
(package private) static final TransportProtocol
Fields inherited from class org.eclipse.jgit.transport.Transport
DEFAULT_FETCH_THIN, DEFAULT_PUSH_THIN, local, protocol, REFSPEC_PUSH_ALL, REFSPEC_TAGS, uri
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
checkExecFailure
(int status, String exe, String why) (package private) NoRemoteRepositoryException
(package private) String
commandFor
(String exe) private void
Begins a new connection for fetching from the remote repository.openFetch
(Collection<RefSpec> refSpecs, String... additionalPatterns) Begins a new connection for fetching from the remote repository.openPush()
Begins a new connection for pushing into the remote repository.private static boolean
Methods inherited from class org.eclipse.jgit.transport.SshTransport
close, getSession, getSshSessionFactory, setSshSessionFactory
Methods inherited from class org.eclipse.jgit.transport.Transport
applyConfig, fetch, fetch, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, getCredentialsProvider, getFilterBlobLimit, getFilterSpec, getObjectChecker, getOptionReceivePack, getOptionUploadPack, getPackConfig, getPushOptions, getTagOpt, getTimeout, getTransportProtocols, getURI, isCheckFetchedObjects, isDryRun, isFetchThin, isPushAtomic, isPushThin, isRemoveDeletedRefs, open, open, open, open, open, open, open, openAll, openAll, openAll, openAll, push, push, register, setCheckFetchedObjects, setCredentialsProvider, setDryRun, setFetchThin, setFilterBlobLimit, setFilterSpec, setObjectChecker, setOptionReceivePack, setOptionUploadPack, setPackConfig, setPushAtomic, setPushOptions, setPushThin, setRemoveDeletedRefs, setTagOpt, setTimeout, unregister
-
Field Details
-
EXT
- See Also:
-
PROTO_SSH
-
-
Constructor Details
-
TransportGitSsh
TransportGitSsh(Repository local, URIish uri) -
TransportGitSsh
TransportGitSsh(URIish uri)
-
-
Method Details
-
initSshSessionFactory
private void initSshSessionFactory() -
openFetch
Begins a new connection for fetching from the remote repository.If the transport has no local repository, the fetch connection can only be used for reading remote refs.
- Specified by:
openFetch
in classTransport
- Returns:
- a fresh connection to fetch from the remote repository.
- Throws:
TransportException
- the remote connection could not be established.
-
openFetch
public FetchConnection openFetch(Collection<RefSpec> refSpecs, String... additionalPatterns) throws NotSupportedException, TransportException Description copied from class:Transport
Begins a new connection for fetching from the remote repository.If the transport has no local repository, the fetch connection can only be used for reading remote refs.
If the server supports git protocol V2, the
RefSpec
s and the additional patterns, if any, are used to restrict the server's ref advertisement to matching refs only.Transports that want to support git protocol V2 must override this; the default implementation ignores its arguments and calls
Transport.openFetch()
.- Overrides:
openFetch
in classTransport
- Parameters:
refSpecs
- that will be fetched viaFetchConnection.fetch(ProgressMonitor, Collection, java.util.Set, OutputStream)
lateradditionalPatterns
- that will be set as ref prefixes if the server supports git protocol V2;null
values are ignored- Returns:
- a fresh connection to fetch from the remote repository.
- Throws:
NotSupportedException
- the implementation does not support fetching.TransportException
- the remote connection could not be established.
-
openPush
Begins a new connection for pushing into the remote repository.- Specified by:
openPush
in classTransport
- Returns:
- a fresh connection to push into the remote repository.
- Throws:
TransportException
- the remote connection could not be established
-
commandFor
-
checkExecFailure
- Throws:
TransportException
-
cleanNotFound
-
useExtSession
private static boolean useExtSession()
-