Class TransportGitSsh

  • All Implemented Interfaces:
    java.lang.AutoCloseable, PackTransport

    public class TransportGitSsh
    extends SshTransport
    implements PackTransport
    Transport through an SSH tunnel.

    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.

    • Constructor Detail

      • TransportGitSsh

        TransportGitSsh​(URIish uri)
    • Method Detail

      • initSshSessionFactory

        private void initSshSessionFactory()
      • openFetch

        public FetchConnection openFetch()
                                  throws TransportException
        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 class Transport
        Returns:
        a fresh connection to fetch from the remote repository.
        Throws:
        TransportException - the remote connection could not be established.
      • openFetch

        public FetchConnection openFetch​(java.util.Collection<RefSpec> refSpecs,
                                         java.lang.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 RefSpecs 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 class Transport
        Parameters:
        refSpecs - that will be fetched via FetchConnection.fetch(ProgressMonitor, Collection, java.util.Set, OutputStream) later
        additionalPatterns - 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.
      • commandFor

        java.lang.String commandFor​(java.lang.String exe)
      • useExtSession

        private static boolean useExtSession()