git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Robin Rosenberg <robin.rosenberg@dewire.com>,
	Marek Zawirski <marek.zawirski@gmail.com>
Cc: git@vger.kernel.org
Subject: [JGIT PATCH 4/5] Report remote SSH execution errors during push via TransportException
Date: Thu, 10 Jul 2008 02:13:22 -0400	[thread overview]
Message-ID: <1215670403-19191-5-git-send-email-spearce@spearce.org> (raw)
In-Reply-To: <1215670403-19191-4-git-send-email-spearce@spearce.org>

If the remote side failed to execute git-receive-pack we may
have the reason why on the stderr stream of the channel, as
the remote shell may have failed execution.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../spearce/jgit/transport/TransportGitSsh.java    |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java
index b169f4c..9a6c719 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java
@@ -228,7 +228,7 @@ class TransportGitSsh extends PackTransport {
 				if (channel.isConnected())
 					init(channel.getInputStream(), channel.getOutputStream());
 				else
-					throw new TransportException(errStream.toString());
+					throw new TransportException(uri, errStream.toString());
 
 			} catch (TransportException err) {
 				close();
@@ -263,7 +263,12 @@ class TransportGitSsh extends PackTransport {
 			super(TransportGitSsh.this);
 			try {
 				channel = exec(getOptionReceivePack());
-				init(channel.getInputStream(), channel.getOutputStream());
+
+				if (channel.isConnected())
+					init(channel.getInputStream(), channel.getOutputStream());
+				else
+					throw new TransportException(uri, errStream.toString());
+
 			} catch (TransportException err) {
 				close();
 				throw err;
-- 
1.5.6.2.393.g45096

  reply	other threads:[~2008-07-10  6:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-10  6:13 [JGIT PATCH 0/5] Yet another round of transport fixes Shawn O. Pearce
2008-07-10  6:13 ` [JGIT PATCH 1/5] Include a progress meter for large uploads to Amazon S3 Shawn O. Pearce
2008-07-10  6:13   ` [JGIT PATCH 2/5] Don't display passwords on the console in fetch/push output Shawn O. Pearce
2008-07-10  6:13     ` [JGIT PATCH 3/5] Reuse the same SSH connection when automatically fetching tags Shawn O. Pearce
2008-07-10  6:13       ` Shawn O. Pearce [this message]
2008-07-10  6:13         ` [JGIT PATCH 5/5] Explicitly capture the stderr from a failed SSH fetch or push Shawn O. Pearce
2008-07-10 18:56     ` [JGIT PATCH 2/5] Don't display passwords on the console in fetch/push output Robin Rosenberg
2008-07-10 20:17       ` Robin Rosenberg
2008-07-10 22:25         ` Johannes Schindelin
2008-07-10 22:42           ` Robin Rosenberg
2008-07-11  3:20         ` Shawn O. Pearce
2008-07-11  8:30           ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1215670403-19191-5-git-send-email-spearce@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=marek.zawirski@gmail.com \
    --cc=robin.rosenberg@dewire.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).