From 8de783e79b8e8f49b3e5ad5d4b426c7505adbf61 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 7 Oct 2010 10:46:34 +0200 Subject: [PATCH] Suppress "unknown output" produced by git.cmd when git is installed in the PATH but the git unix tools aren't. --- src/AddIns/VersionControl/GitAddIn/Src/GitStatusCache.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AddIns/VersionControl/GitAddIn/Src/GitStatusCache.cs b/src/AddIns/VersionControl/GitAddIn/Src/GitStatusCache.cs index cbeaa11cdf..735ea7dcb2 100644 --- a/src/AddIns/VersionControl/GitAddIn/Src/GitStatusCache.cs +++ b/src/AddIns/VersionControl/GitAddIn/Src/GitStatusCache.cs @@ -93,13 +93,18 @@ namespace ICSharpCode.GitAddIn ProcessRunner runner = new ProcessRunner(); runner.WorkingDirectory = wcRoot; runner.LogStandardOutputAndError = false; + string commandPrompt = wcRoot + ">@"; // C:\work\SD>@git.exe %* runner.OutputLineReceived += delegate(object sender, LineReceivedEventArgs e) { if (!string.IsNullOrEmpty(e.Line)) { Match m = statusParseRegex.Match(e.Line); if (m.Success) { statusSet.AddEntry(m.Groups[2].Value, StatusFromText(m.Groups[1].Value)); - } else { + } else if (!e.Line.StartsWith(commandPrompt, StringComparison.Ordinal)) { + // Suppress "unknown output" produced by git.cmd when git is installed + // in the PATH but the git unix tools aren't + if (!hasErrors) { + // in front of first output line, print the command line we invoked hasErrors = true; GitMessageView.AppendLine(runner.WorkingDirectory + "> " + command); }