繁体   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