diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index 3fdc62259..680aff63d 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -46,9 +46,22 @@ public Diff(string repo, Models.DiffOption opt, int unified, bool ignoreWhitespa proc.StartInfo = CreateGitStartInfo(true); proc.Start(); - while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { } line) + var text = await proc.StandardOutput.ReadToEndAsync().ConfigureAwait(false); + + var start = 0; + var end = text.IndexOf('\n', start); + while (end > 0) + { + var line = text[start..end]; ParseLine(line); + start = end + 1; + end = text.IndexOf('\n', start); + } + + if (start < text.Length) + ParseLine(text[start..]); + await proc.WaitForExitAsync().ConfigureAwait(false); } catch