Skip to content

Commit 77f7922

Browse files
authored
Merge pull request #804 from mjcheetham/diagnose-hang
Reorder Git config list process exit wait in diagnose command
2 parents 162d657 + 47ba58f commit 77f7922

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/shared/Core/Diagnostics/GitDiagnostic.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ protected override Task<bool> RunInternalAsync(StringBuilder log, IList<string>
3232
log.Append("Listing all Git configuration...");
3333
Process configProc = _git.CreateProcess("config --list --show-origin");
3434
configProc.Start();
35-
configProc.WaitForExit();
35+
// To avoid deadlocks, always read the output stream first and then wait
36+
// TODO: don't read in all the data at once; stream it
3637
string gitConfig = configProc.StandardOutput.ReadToEnd().TrimEnd();
38+
configProc.WaitForExit();
3739
log.AppendLine(" OK");
3840
log.AppendLine("Git configuration:");
3941
log.AppendLine(gitConfig);

0 commit comments

Comments
 (0)