summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java30
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java1
2 files changed, 30 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java
index f5e3c504c2..1e03567500 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008, Charles O'Farrell <charleso@charleso.org>
- * Copyright (C) 2008-2009, Google Inc.
+ * Copyright (C) 2008-2010, Google Inc.
* Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
* and other copyright owners as documented in the project's IP log.
@@ -79,6 +79,34 @@ abstract class AbstractFetchCommand extends TextBuiltin {
out.format(" %c %-17s %-10s -> %s", type, longType, src, dst);
out.println();
}
+
+ showRemoteMessages(r.getMessages());
+ }
+
+ static void showRemoteMessages(String pkt) {
+ while (0 < pkt.length()) {
+ final int lf = pkt.indexOf('\n');
+ final int cr = pkt.indexOf('\r');
+ final int s;
+ if (0 <= lf && 0 <= cr)
+ s = Math.min(lf, cr);
+ else if (0 <= lf)
+ s = lf;
+ else if (0 <= cr)
+ s = cr;
+ else {
+ System.err.println("remote: " + pkt);
+ break;
+ }
+
+ if (pkt.charAt(s) == '\r')
+ System.err.print("remote: " + pkt.substring(0, s) + "\r");
+ else
+ System.err.println("remote: " + pkt.substring(0, s));
+
+ pkt = pkt.substring(s + 1);
+ }
+ System.err.flush();
}
private String longTypeOf(final TrackingRefUpdate u) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
index 6248ec2991..2c02545639 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
@@ -162,6 +162,7 @@ class Push extends TextBuiltin {
printRefUpdateResult(uri, result, rru);
}
+ AbstractFetchCommand.showRemoteMessages(result.getMessages());
if (everythingUpToDate)
out.println("Everything up-to-date");
}