Transport through a git-daemon waiting for anonymous TCP connections. This transport supports the git:// protocol, usually run on the IANA registered port 9418. It is a popular means for distributing open source projects, as there are no authentication or authorization overheads.
Inheritance: GitSharp.Core.Transport.TcpTransport, IPackTransport
Ejemplo n.º 1
0
 public TcpPushConnection(TransportGitAnon instance)
     : base(instance)
 {
     _sock = instance.OpenConnection();
     try
     {
         init(new NetworkStream(_sock));
         instance.Service("git-receive-pack", pckOut);
     }
     catch (SocketException err)
     {
         Close();
         throw new TransportException(uri, "remote hung up unexpectedly", err);
     }
     readAdvertisedRefs();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Open a new transport instance to connect two repositories.
        /// </summary>
        /// <param name="local">existing local repository.</param>
        /// <param name="remote">location of the remote repository.</param>
        /// <returns>the new transport instance. Never null.</returns>
        public static Transport open(Repository local, URIish remote)
        {
            if (TransportGitSsh.canHandle(remote))
            {
                return(new TransportGitSsh(local, remote));
            }

            if (TransportHttp.canHandle(remote))
            {
                return(new TransportHttp(local, remote));
            }

            if (TransportSftp.canHandle(remote))
            {
                return(new TransportSftp(local, remote));
            }

            if (TransportGitAnon.canHandle(remote))
            {
                return(new TransportGitAnon(local, remote));
            }

            if (TransportAmazonS3.canHandle(remote))
            {
                return(new TransportAmazonS3(local, remote));
            }

            if (TransportBundleFile.canHandle(remote))
            {
                return(new TransportBundleFile(local, remote));
            }

            if (TransportLocal.canHandle(remote))
            {
                return(new TransportLocal(local, remote));
            }

            throw new NotSupportedException("URI not supported: " + remote);
        }
Ejemplo n.º 3
0
 public TcpPushConnection(TransportGitAnon instance)
     : base(instance)
 {
     _sock = instance.OpenConnection();
     try
     {
         init(new NetworkStream(_sock));
         instance.Service("git-receive-pack", pckOut);
     }
     catch (SocketException err)
     {
         Close();
         throw new TransportException(uri, "remote hung up unexpectedly", err);
     }
     readAdvertisedRefs();
 }