Skip to content

Commit ee30817

Browse files
committed
Merge pull request #751 from JakeGinnivan/NicerErrorWhenGitMissingOnDumpGraph
Display nicer error message when git is not on the path and GitVersio…
2 parents 4b0dc11 + ceabc0d commit ee30817

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/GitVersionCore/Helpers/ProcessHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static Process Start(ProcessStartInfo startInfo)
4848
// http://csharptest.net/532/using-processstart-to-capture-console-output/
4949
public static int Run(Action<string> output, Action<string> errorOutput, TextReader input, string exe, string args, string workingDirectory, params KeyValuePair<string, string>[] environmentalVariables)
5050
{
51-
if (String.IsNullOrEmpty(exe))
51+
if (string.IsNullOrEmpty(exe))
5252
throw new ArgumentNullException("exe");
5353

5454
if (output == null)

src/GitVersionCore/LibGitExtensions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,9 @@ public static void DumpGraph(string workingDirectory, Action<string> writer = nu
267267
catch (FileNotFoundException exception)
268268
{
269269
if (exception.FileName != "git")
270-
{
271270
throw;
272-
}
273271

274-
output.AppendLine("Could not execute 'git log' due to the following error:");
275-
output.AppendLine(exception.ToString());
272+
output.AppendLine("Unable to display git log (due to 'git' not being on the %PATH%), this is just for debugging purposes to give more information to track down your issue. Run gitversion debug locally instead.");
276273
}
277274

278275
if (writer != null) writer(output.ToString());

0 commit comments

Comments
 (0)