[pgm] Prevent commands from writing progress to System.err
Commands which report progress used to write to System.err. This is not desirable in cases where jgit.pgm is embedded. This change redirects progress output to the error stream that is configured by the command. Change-Id: I01fa5e167437e619448ac201fcb1cbf63bad96d7 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
7fafd37298
commit
3285d2f238
|
@ -199,7 +199,7 @@ protected void run() throws Exception {
|
||||||
} else if (newTree == null)
|
} else if (newTree == null)
|
||||||
newTree = new FileTreeIterator(db);
|
newTree = new FileTreeIterator(db);
|
||||||
|
|
||||||
TextProgressMonitor pm = new TextProgressMonitor();
|
TextProgressMonitor pm = new TextProgressMonitor(errw);
|
||||||
pm.setDelayStart(2, TimeUnit.SECONDS);
|
pm.setDelayStart(2, TimeUnit.SECONDS);
|
||||||
diffFmt.setProgressMonitor(pm);
|
diffFmt.setProgressMonitor(pm);
|
||||||
diffFmt.setPathFilter(pathFilter);
|
diffFmt.setPathFilter(pathFilter);
|
||||||
|
|
|
@ -123,7 +123,7 @@ protected void run() throws Exception {
|
||||||
if (thin != null)
|
if (thin != null)
|
||||||
fetch.setThin(thin.booleanValue());
|
fetch.setThin(thin.booleanValue());
|
||||||
if (quiet == null || !quiet.booleanValue())
|
if (quiet == null || !quiet.booleanValue())
|
||||||
fetch.setProgressMonitor(new TextProgressMonitor());
|
fetch.setProgressMonitor(new TextProgressMonitor(errw));
|
||||||
|
|
||||||
FetchResult result = fetch.call();
|
FetchResult result = fetch.call();
|
||||||
if (result.getTrackingRefUpdates().isEmpty())
|
if (result.getTrackingRefUpdates().isEmpty())
|
||||||
|
|
|
@ -56,6 +56,6 @@ class Gc extends TextBuiltin {
|
||||||
protected void run() throws Exception {
|
protected void run() throws Exception {
|
||||||
Git git = Git.wrap(db);
|
Git git = Git.wrap(db);
|
||||||
git.gc().setAggressive(aggressive)
|
git.gc().setAggressive(aggressive)
|
||||||
.setProgressMonitor(new TextProgressMonitor()).call();
|
.setProgressMonitor(new TextProgressMonitor(errw)).call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ protected void run() throws Exception {
|
||||||
ObjectDirectoryPackParser imp = (ObjectDirectoryPackParser) p;
|
ObjectDirectoryPackParser imp = (ObjectDirectoryPackParser) p;
|
||||||
imp.setIndexVersion(indexVersion);
|
imp.setIndexVersion(indexVersion);
|
||||||
}
|
}
|
||||||
p.parse(new TextProgressMonitor());
|
p.parse(new TextProgressMonitor(errw));
|
||||||
inserter.flush();
|
inserter.flush();
|
||||||
} finally {
|
} finally {
|
||||||
inserter.release();
|
inserter.release();
|
||||||
|
|
|
@ -113,7 +113,7 @@ protected void run() throws Exception {
|
||||||
PushCommand push = git.push();
|
PushCommand push = git.push();
|
||||||
push.setDryRun(dryRun);
|
push.setDryRun(dryRun);
|
||||||
push.setForce(force);
|
push.setForce(force);
|
||||||
push.setProgressMonitor(new TextProgressMonitor());
|
push.setProgressMonitor(new TextProgressMonitor(errw));
|
||||||
push.setReceivePack(receivePack);
|
push.setReceivePack(receivePack);
|
||||||
push.setRefSpecs(refSpecs);
|
push.setRefSpecs(refSpecs);
|
||||||
if (all)
|
if (all)
|
||||||
|
|
|
@ -110,7 +110,7 @@ class RebuildCommitGraph extends TextBuiltin {
|
||||||
@Argument(index = 1, required = true, metaVar = "metaVar_refs", usage = "usage_logAllPretty")
|
@Argument(index = 1, required = true, metaVar = "metaVar_refs", usage = "usage_logAllPretty")
|
||||||
File graph;
|
File graph;
|
||||||
|
|
||||||
private final ProgressMonitor pm = new TextProgressMonitor();
|
private final ProgressMonitor pm = new TextProgressMonitor(errw);
|
||||||
|
|
||||||
private Map<ObjectId, ObjectId> rewrites = new HashMap<ObjectId, ObjectId>();
|
private Map<ObjectId, ObjectId> rewrites = new HashMap<ObjectId, ObjectId>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue