| 400 | } |
| 401 | |
| 402 | private static string RunGit(string WorkingDir, string Arguments) |
| 403 | { |
| 404 | ProcessStartInfo PSI = new ProcessStartInfo("git", Arguments) |
| 405 | { |
| 406 | WorkingDirectory = WorkingDir, |
| 407 | RedirectStandardOutput = true, |
| 408 | RedirectStandardError = true, |
| 409 | UseShellExecute = false, |
| 410 | CreateNoWindow = true, |
| 411 | }; |
| 412 | using (Process Proc = Process.Start(PSI)) |
| 413 | { |
| 414 | string Stdout = Proc.StandardOutput.ReadToEnd(); |
| 415 | string Stderr = Proc.StandardError.ReadToEnd(); |
| 416 | Proc.WaitForExit(); |
| 417 | if (Proc.ExitCode != 0) |
| 418 | { |
| 419 | throw new Exception(string.Format("git {0} exited {1}: {2}", |
| 420 | Arguments, Proc.ExitCode, Stderr.Trim())); |
| 421 | } |
| 422 | return Stdout.Trim(); |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | private static string ParseSubmodulePointerSha(string Output, string Package) |
| 427 | { |