mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 19:55:00 +00:00
code_review: PR #1177
- use `Command.ReadToEnd` instead of `Command.Exec` to avoid git trims line endings. - use `StringBuilder.Append('\n')` instead of `StringBuilder.AppendLine()` to restore original line endings (we split the original diff output by `\n` not `\r') - there's no need to show file content (the `StreamReader.ReadLine()` will trim line endings) Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
81820e7034
commit
e89dbd8f43
3 changed files with 31 additions and 53 deletions
|
@ -1253,11 +1253,12 @@ namespace SourceGit.Views
|
|||
{
|
||||
builder.Append(line.Content.Substring(0, 1000));
|
||||
builder.Append($"...({line.Content.Length - 1000} character trimmed)");
|
||||
builder.AppendLine();
|
||||
builder.Append('\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine(line.Content);
|
||||
builder.Append(line.Content);
|
||||
builder.Append('\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1492,11 +1493,12 @@ namespace SourceGit.Views
|
|||
{
|
||||
builder.Append(line.Content.Substring(0, 1000));
|
||||
builder.Append($"...({line.Content.Length - 1000} characters trimmed)");
|
||||
builder.AppendLine();
|
||||
builder.Append('\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine(line.Content);
|
||||
builder.Append(line.Content);
|
||||
builder.Append('\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue