简体   繁体   中英

Git for windows stops working after “verify bundle” inside a process

Using .NET4 on Microsoft Visual Studio 2015

I have a function to validate bundle files. The Git command is running inside a process, like so:

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". Why is it breaking GIT during the process? 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

It seems to be a bug with the mingw version of Git for Windows , it does not happen with Cygwin's version.

If possible use Cygwin's version although it's an earlier version of git as it does not have this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM