From 58824cba013a98e4e0f5fb2940f52205d70b9f00 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 17 Jan 2014 16:12:17 +0100 Subject: [PATCH] Fix #283 - Crash when adding new folder/file to project --- .../Project/Src/RestorePackagesCommand.cs | 2 +- src/AddIns/VersionControl/GitAddIn/Src/Git.cs | 8 ++++++-- src/Main/Base/Project/Templates/ProjectTemplate.cs | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs b/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs index 7c3775791b..dd087a7569 100644 --- a/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs +++ b/src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs @@ -56,7 +56,7 @@ namespace ICSharpCode.PackageManagement var runner = new ProcessRunner(); runner.WorkingDirectory = Path.GetDirectoryName(solution.FileName); - runner.RunInOutputPadAsync(outputMessagesView.OutputCategory, commandLine.Command, commandLine.Arguments); + runner.RunInOutputPadAsync(outputMessagesView.OutputCategory, commandLine.Command, commandLine.Arguments).FireAndForget(); } } } diff --git a/src/AddIns/VersionControl/GitAddIn/Src/Git.cs b/src/AddIns/VersionControl/GitAddIn/Src/Git.cs index 39a28cabbe..cbc307cf59 100644 --- a/src/AddIns/VersionControl/GitAddIn/Src/Git.cs +++ b/src/AddIns/VersionControl/GitAddIn/Src/Git.cs @@ -66,9 +66,12 @@ namespace ICSharpCode.GitAddIn public static Task RunGitAsync(string workingDir, params string[] arguments) { + string git = FindGit(); + if (git == null) + return Task.FromResult(9009); ProcessRunner p = new ProcessRunner(); p.WorkingDirectory = workingDir; - return p.RunInOutputPadAsync(GitMessageView.Category, "git", arguments); + return p.RunInOutputPadAsync(GitMessageView.Category, git, arguments); } /// @@ -92,7 +95,8 @@ namespace ICSharpCode.GitAddIn // ignore invalid entries in PATH } } - string gitExe = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify), "bin\\git.exe"); + string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify); + string gitExe = Path.Combine(programFiles, @"git\bin\git.exe"); if (File.Exists(gitExe)) return gitExe; return null; diff --git a/src/Main/Base/Project/Templates/ProjectTemplate.cs b/src/Main/Base/Project/Templates/ProjectTemplate.cs index 33450d91ff..4ab0922d1b 100644 --- a/src/Main/Base/Project/Templates/ProjectTemplate.cs +++ b/src/Main/Base/Project/Templates/ProjectTemplate.cs @@ -30,9 +30,9 @@ namespace ICSharpCode.SharpDevelop.Templates /// /// Creates projects from the template; and adds them to the solution specified in the parameter object. /// - /// Paramter object used to pass options for the template creation. + /// Parameter object used to pass options for the template creation. /// - /// Returns a result object that describes the project that were created; + /// Returns a result object that describes the projects that were created; /// or null if the operation was aborted. /// /// Error writing the projects to disk