簡體   English   中英

Windows Git for Windows在進程中“驗證捆綁包”后停止工作

[英]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

Windows的gitw版本的mingw版本似乎是一個錯誤,而Cygwin的版本則不會發生。

如果可能,請使用Cygwin的版本,盡管它是git的早期版本,因為它沒有此問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM