Exemplo n.º 1
0
        public virtual void TestMissingPort()
        {
            string incorrectSshUrl = "ssh://some-host:/path/to/repository.git";
            URIish u = new URIish(incorrectSshUrl);

            NUnit.Framework.Assert.IsFalse(TransportGitSsh.CanHandle(u));
        }
Exemplo n.º 2
0
 /// <exception cref="NGit.Errors.TransportException"></exception>
 internal SshPushConnection(TransportGitSsh _enclosing, TransportGitSsh.Connection
                            conn) : base(_enclosing)
 {
     this._enclosing = _enclosing;
     this.conn       = conn;
     try
     {
         MessageWriter msg = new MessageWriter();
         this.SetMessageWriter(msg);
         conn.Exec(this._enclosing.GetOptionReceivePack());
         InputStream rpErr = conn.GetErrorStream();
         this.errorThread = new StreamCopyThread(rpErr, msg.GetRawStream());
         this.errorThread.Start();
         this.Init(conn.GetInputStream(), conn.GetOutputStream());
         conn.Connect();
     }
     catch (TransportException err)
     {
         this.Close();
         throw;
     }
     catch (IOException err)
     {
         this.Close();
         throw new TransportException(this.uri, JGitText.Get().remoteHungUpUnexpectedly, err
                                      );
     }
     try
     {
         this.ReadAdvertisedRefs();
     }
     catch (NoRemoteRepositoryException notFound)
     {
         string msgs = this.GetMessages();
         this._enclosing.CheckExecFailure(conn.GetExitStatus(), this._enclosing.GetOptionReceivePack
                                              (), msgs);
         throw this._enclosing.CleanNotFound(notFound, msgs);
     }
 }
Exemplo n.º 3
0
 /// <exception cref="NGit.Errors.TransportException"></exception>
 public SshPushConnection(TransportGitSsh _enclosing) : base(_enclosing)
 {
     this._enclosing = _enclosing;
     try
     {
         this.process = this._enclosing.GetSession().Exec(this._enclosing.CommandFor(this.
                                                                                     _enclosing.GetOptionReceivePack()), this._enclosing.GetTimeout());
         MessageWriter msg = new MessageWriter();
         this.SetMessageWriter(msg);
         InputStream rpErr = this.process.GetErrorStream();
         this.errorThread = new StreamCopyThread(rpErr, msg.GetRawStream());
         this.errorThread.Start();
         this.Init(this.process.GetInputStream(), this.process.GetOutputStream());
     }
     catch (TransportException err)
     {
         this.Close();
         throw;
     }
     catch (IOException err)
     {
         this.Close();
         throw new TransportException(this.uri, JGitText.Get().remoteHungUpUnexpectedly, err
                                      );
     }
     try
     {
         this.ReadAdvertisedRefs();
     }
     catch (NoRemoteRepositoryException notFound)
     {
         string msgs = this.GetMessages();
         this._enclosing.CheckExecFailure(this.process.ExitValue(), this._enclosing.GetOptionReceivePack
                                              (), msgs);
         throw this._enclosing.CleanNotFound(notFound, msgs);
     }
 }
Exemplo n.º 4
0
			/// <exception cref="NGit.Errors.TransportException"></exception>
			public SshPushConnection(TransportGitSsh _enclosing) : base(_enclosing)
			{
				this._enclosing = _enclosing;
				try
				{
					this.process = this._enclosing.GetSession().Exec(this._enclosing.CommandFor(this.
						_enclosing.GetOptionReceivePack()), this._enclosing.GetTimeout());
					MessageWriter msg = new MessageWriter();
					this.SetMessageWriter(msg);
					InputStream rpErr = this.process.GetErrorStream();
					this.errorThread = new StreamCopyThread(rpErr, msg.GetRawStream());
					this.errorThread.Start();
					this.Init(this.process.GetInputStream(), this.process.GetOutputStream());
				}
				catch (TransportException err)
				{
					this.Close();
					throw;
				}
				catch (IOException err)
				{
					this.Close();
					throw new TransportException(this.uri, JGitText.Get().remoteHungUpUnexpectedly, err
						);
				}
				try
				{
					this.ReadAdvertisedRefs();
				}
				catch (NoRemoteRepositoryException notFound)
				{
					string msgs = this.GetMessages();
					this._enclosing.CheckExecFailure(this.process.ExitValue(), this._enclosing.GetOptionReceivePack
						(), msgs);
					throw this._enclosing.CleanNotFound(notFound, msgs);
				}
			}
Exemplo n.º 5
0
			internal ExtSession(TransportGitSsh _enclosing)
			{
				this._enclosing = _enclosing;
			}
Exemplo n.º 6
0
			public _SshSessionFactory_134(TransportGitSsh _enclosing)
			{
				this._enclosing = _enclosing;
			}
Exemplo n.º 7
0
			/// <exception cref="NGit.Errors.TransportException"></exception>
			internal SshPushConnection(TransportGitSsh _enclosing, TransportGitSsh.Connection
				 conn) : base(_enclosing)
			{
				this._enclosing = _enclosing;
				this.conn = conn;
				try
				{
					MessageWriter msg = new MessageWriter();
					this.SetMessageWriter(msg);
					conn.Exec(this._enclosing.GetOptionReceivePack());
					InputStream rpErr = conn.GetErrorStream();
					this.errorThread = new StreamCopyThread(rpErr, msg.GetRawStream());
					this.errorThread.Start();
					this.Init(conn.GetInputStream(), conn.GetOutputStream());
					conn.Connect();
				}
				catch (TransportException err)
				{
					this.Close();
					throw;
				}
				catch (IOException err)
				{
					this.Close();
					throw new TransportException(this.uri, JGitText.Get().remoteHungUpUnexpectedly, err
						);
				}
				try
				{
					this.ReadAdvertisedRefs();
				}
				catch (NoRemoteRepositoryException notFound)
				{
					string msgs = this.GetMessages();
					this._enclosing.CheckExecFailure(conn.GetExitStatus(), this._enclosing.GetOptionReceivePack
						(), msgs);
					throw this._enclosing.CleanNotFound(notFound, msgs);
				}
			}
Exemplo n.º 8
0
			internal ExtConnection(TransportGitSsh _enclosing) : base(_enclosing)
			{
				this._enclosing = _enclosing;
			}
Exemplo n.º 9
0
			internal Connection(TransportGitSsh _enclosing)
			{
				this._enclosing = _enclosing;
			}
Exemplo n.º 10
0
 internal ExtSession(TransportGitSsh _enclosing)
 {
     this._enclosing = _enclosing;
 }
Exemplo n.º 11
0
 public _SshSessionFactory_134(TransportGitSsh _enclosing)
 {
     this._enclosing = _enclosing;
 }
Exemplo n.º 12
0
 internal ExtConnection(TransportGitSsh _enclosing) : base(_enclosing)
 {
     this._enclosing = _enclosing;
 }
Exemplo n.º 13
0
 internal Connection(TransportGitSsh _enclosing)
 {
     this._enclosing = _enclosing;
 }