diff options
author | Guillaume Nodet <gnodet@gmail.com> | 2014-01-28 10:19:59 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2014-03-30 23:25:09 +0200 |
commit | c0574fe680a45a27ca2d278ecb0cc1a1bfd3a440 (patch) | |
tree | f025a07f9eaaaac7abf2ea50f6bdcffe9d33dbd0 /org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java | |
parent | c8d2040722d8d332a094b07a448d0ba9fc4509eb (diff) | |
download | jgit-c0574fe680a45a27ca2d278ecb0cc1a1bfd3a440.tar.gz jgit-c0574fe680a45a27ca2d278ecb0cc1a1bfd3a440.zip |
Add an input stream and an error stream to TextBuiltin base class
Leverage these streams to remove calls to System.in and System.err
Bug: 413522
Change-Id: I8396f3e273c93e23861e8bcfb2ab8182fb09220d
Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java | 7 |
1 files changed, 3 insertions, 4 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 1fe39da8a6..d226df21bb 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 @@ -50,7 +50,6 @@ package org.eclipse.jgit.pgm; import static java.lang.Character.valueOf; import java.io.IOException; -import java.io.PrintWriter; import java.text.MessageFormat; import org.eclipse.jgit.lib.Constants; @@ -60,6 +59,7 @@ import org.eclipse.jgit.lib.RefUpdate; import org.eclipse.jgit.pgm.internal.CLIText; import org.eclipse.jgit.transport.FetchResult; import org.eclipse.jgit.transport.TrackingRefUpdate; +import org.eclipse.jgit.util.io.ThrowingPrintWriter; import org.kohsuke.args4j.Option; abstract class AbstractFetchCommand extends TextBuiltin { @@ -92,11 +92,10 @@ abstract class AbstractFetchCommand extends TextBuiltin { } finally { reader.release(); } - showRemoteMessages(r.getMessages()); + showRemoteMessages(errw, r.getMessages()); } - static void showRemoteMessages(String pkt) { - PrintWriter writer = new PrintWriter(System.err); + static void showRemoteMessages(ThrowingPrintWriter writer, String pkt) throws IOException { while (0 < pkt.length()) { final int lf = pkt.indexOf('\n'); final int cr = pkt.indexOf('\r'); |