mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
fix<CommitViewer>: fix save revision file to path error when selected file is managed by LFS
This commit is contained in:
parent
0e48344401
commit
db799f5c92
3 changed files with 37 additions and 29 deletions
|
@ -184,32 +184,6 @@ namespace SourceGit.Git {
|
|||
return RunCommand(Path, args, outputHandler, includeError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create process and redirect output to file.
|
||||
/// </summary>
|
||||
/// <param name="args">Git command arguments.</param>
|
||||
/// <param name="redirectTo">File path to redirect output into.</param>
|
||||
public void RunAndRedirect(string args, string redirectTo) {
|
||||
var startInfo = new ProcessStartInfo();
|
||||
startInfo.FileName = Preference.Instance.GitExecutable;
|
||||
startInfo.Arguments = "--no-pager " + args;
|
||||
startInfo.WorkingDirectory = Path;
|
||||
startInfo.UseShellExecute = false;
|
||||
startInfo.CreateNoWindow = true;
|
||||
startInfo.RedirectStandardOutput = true;
|
||||
startInfo.RedirectStandardError = true;
|
||||
|
||||
var proc = new Process() { StartInfo = startInfo };
|
||||
proc.Start();
|
||||
|
||||
using (var writer = new FileStream(redirectTo, FileMode.OpenOrCreate)) {
|
||||
proc.StandardOutput.BaseStream.CopyTo(writer);
|
||||
}
|
||||
|
||||
proc.WaitForExit();
|
||||
proc.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assert command result and then update branches and commits.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue