Browse Source

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>
stable-4.5
Rüdiger Herrmann 9 years ago committed by Matthias Sohn
parent
commit
b3f4abdda1
  1. 10
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java

10
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 {

Loading…
Cancel
Save