Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 58824cb

Browse files
committed
Fix #283 - Crash when adding new folder/file to project
1 parent 00113de commit 58824cb

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/AddIns/Misc/PackageManagement/Project/Src/RestorePackagesCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void RunRestore()
5656

5757
var runner = new ProcessRunner();
5858
runner.WorkingDirectory = Path.GetDirectoryName(solution.FileName);
59-
runner.RunInOutputPadAsync(outputMessagesView.OutputCategory, commandLine.Command, commandLine.Arguments);
59+
runner.RunInOutputPadAsync(outputMessagesView.OutputCategory, commandLine.Command, commandLine.Arguments).FireAndForget();
6060
}
6161
}
6262
}

src/AddIns/VersionControl/GitAddIn/Src/Git.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ public static string AdaptFileName(string wcRoot, string fileName)
6666

6767
public static Task<int> RunGitAsync(string workingDir, params string[] arguments)
6868
{
69+
string git = FindGit();
70+
if (git == null)
71+
return Task.FromResult(9009);
6972
ProcessRunner p = new ProcessRunner();
7073
p.WorkingDirectory = workingDir;
71-
return p.RunInOutputPadAsync(GitMessageView.Category, "git", arguments);
74+
return p.RunInOutputPadAsync(GitMessageView.Category, git, arguments);
7275
}
7376

7477
/// <summary>
@@ -92,7 +95,8 @@ public static string FindGit()
9295
// ignore invalid entries in PATH
9396
}
9497
}
95-
string gitExe = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify), "bin\\git.exe");
98+
string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify);
99+
string gitExe = Path.Combine(programFiles, @"git\bin\git.exe");
96100
if (File.Exists(gitExe))
97101
return gitExe;
98102
return null;

src/Main/Base/Project/Templates/ProjectTemplate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public virtual IEnumerable<TargetFramework> SupportedTargetFrameworks {
3030
/// <summary>
3131
/// Creates projects from the template; and adds them to the solution specified in the parameter object.
3232
/// </summary>
33-
/// <param name="options">Paramter object used to pass options for the template creation.</param>
33+
/// <param name="options">Parameter object used to pass options for the template creation.</param>
3434
/// <returns>
35-
/// Returns a result object that describes the project that were created;
35+
/// Returns a result object that describes the projects that were created;
3636
/// or null if the operation was aborted.
3737
/// </returns>
3838
/// <exception cref="IOException">Error writing the projects to disk</exception>

0 commit comments

Comments
 (0)