fix: improve line splitting to handle both LF and CRLF line endings (#1106)

This commit is contained in:
Gadfly 2025-03-17 19:59:28 +08:00 committed by GitHub
parent a0cddaea80
commit b930066b5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -16,7 +16,7 @@ namespace SourceGit.Commands
var rs = ReadToEnd();
if (rs.IsSuccess)
{
var lines = rs.StdOut.Split('\n', StringSplitOptions.RemoveEmptyEntries);
var lines = rs.StdOut.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries);
return lines.Length;
}