Exemple #1
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);
     }
 }
			/// <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);
				}
			}