[英]Git for windows stops working after “verify bundle” inside a process
在Microsoft Visual Studio 2015上使用.NET4
我具有驗證捆綁文件的功能。 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();
}
每當.bundle文件無效時,在p.Start之后,Git都會停止,並打開一個彈出窗口,提示:“ Windows的Git停止工作”。 為什么在此過程中破壞了GIT? 我該怎么做才能攔截此錯誤並避免在運行時中斷應用程序?
編輯:對相同的文件在Git Bash上手動運行命令輸出Segmentation Error
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.