Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Commands/Diff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down