[英]Git for windows stops working after “verify bundle” inside a process
Using .NET4 on Microsoft Visual Studio 2015 在Microsoft Visual Studio 2015上使用.NET4
I have a function to validate bundle files. 我具有验证捆绑文件的功能。 The Git command is running inside a process, like so:
Git命令在进程内部运行,如下所示:
public VerifyBundle(String bundlePath, String repositoryPath){
Directory.SetCurrentDirectory(repositoryPath);
Process p = new Process
{
//set process configuration
StartInfo = new ProcessStartInfo
{
UseShellExecute = false,
FileName = "cmd.exe",
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
WorkingDirectory = path,
Arguments = "/C git bundle verify " + bundlePath,
WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
}
};
p.Start();
string output = p.StandardOutput.ReadToEnd();
}
Whenever the .bundle file is not valid, right after the p.Start, Git stops, and opens a popup saying: "Git for windows stopped working". 每当.bundle文件无效时,在p.Start之后,Git都会停止,并打开一个弹出窗口,提示:“ Windows的Git停止工作”。 Why is it breaking GIT during the process?
为什么在此过程中破坏了GIT? What can I do to intercept this error and avoid disrupting my application during run time?
我该怎么做才能拦截此错误并避免在运行时中断应用程序?
EDIT: Running the command manually on Git Bash against the same file outputs Segmentation Error
编辑:对相同的文件在Git Bash上手动运行命令输出
Segmentation Error
It seems to be a bug with the mingw version of Git for Windows , it does not happen with Cygwin's version. Windows的gitw版本的mingw版本似乎是一个错误,而Cygwin的版本则不会发生。
If possible use Cygwin's version although it's an earlier version of git as it does not have this issue. 如果可能,请使用Cygwin的版本,尽管它是git的早期版本,因为它没有此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.