Skip to content

Commit

Permalink
Merge pull request #804 from mjcheetham/diagnose-hang
Browse files Browse the repository at this point in the history
Reorder Git config list process exit wait in diagnose command
  • Loading branch information
mjcheetham committed Jul 25, 2022
2 parents 162d657 + 47ba58f commit 77f7922
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shared/Core/Diagnostics/GitDiagnostic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ protected override Task<bool> RunInternalAsync(StringBuilder log, IList<string>
log.Append("Listing all Git configuration...");
Process configProc = _git.CreateProcess("config --list --show-origin");
configProc.Start();
configProc.WaitForExit();
// To avoid deadlocks, always read the output stream first and then wait
// TODO: don't read in all the data at once; stream it
string gitConfig = configProc.StandardOutput.ReadToEnd().TrimEnd();
configProc.WaitForExit();
log.AppendLine(" OK");
log.AppendLine("Git configuration:");
log.AppendLine(gitConfig);
Expand Down

0 comments on commit 77f7922

Please sign in to comment.