diff options
author | RĂ¼diger Herrmann <ruediger.herrmann@gmx.de> | 2016-05-20 14:06:08 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-21 01:52:28 +0200 |
commit | b3f4abdda1f00c7ca72f3c7c95e180e28b9aa776 (patch) | |
tree | cc072f711539ab3fe24054f42e0a7c9e0dfe3a3b /org.eclipse.jgit.pgm | |
parent | 1f86350c5a97d8c6966fe1146d649eb5cbc60f53 (diff) | |
download | jgit-b3f4abdda1f00c7ca72f3c7c95e180e28b9aa776.tar.gz jgit-b3f4abdda1f00c7ca72f3c7c95e180e28b9aa776.zip |
Redirect all Show output to outs
The Show command wrote all diffs to System.out instead of 'outs.
Bug: 494143
Change-Id: Ibc78e9a058b7a32d536e03e294c1d933b6c26ba7
Signed-off-by: RĂ¼diger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java index c5986b01aa..6892c9973f 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java @@ -63,6 +63,7 @@ import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileMode; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.PersonIdent; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.pgm.internal.CLIText; import org.eclipse.jgit.pgm.opt.PathTreeFilterHandler; import org.eclipse.jgit.revwalk.RevCommit; @@ -81,8 +82,7 @@ class Show extends TextBuiltin { private final DateFormat fmt; - private final DiffFormatter diffFmt = new DiffFormatter( // - new BufferedOutputStream(System.out)); + private DiffFormatter diffFmt; @Argument(index = 0, metaVar = "metaVar_object") private String objectName; @@ -165,6 +165,12 @@ class Show extends TextBuiltin { fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US); //$NON-NLS-1$ } + @Override + protected void init(final Repository repository, final String gitDir) { + super.init(repository, gitDir); + diffFmt = new DiffFormatter(new BufferedOutputStream(outs)); + } + @SuppressWarnings("boxing") @Override protected void run() throws Exception { |