mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 19:55:00 +00:00
fix: no diff content shows with new files (#1193)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
a97f163860
commit
be3f418680
1 changed files with 3 additions and 13 deletions
|
@ -36,12 +36,6 @@ namespace SourceGit.Commands
|
|||
public Models.DiffResult Result()
|
||||
{
|
||||
var rs = ReadToEnd();
|
||||
if (!rs.IsSuccess)
|
||||
{
|
||||
_result.TextDiff = null;
|
||||
return _result;
|
||||
}
|
||||
|
||||
var start = 0;
|
||||
var end = rs.StdOut.IndexOf('\n', start);
|
||||
while (end > 0)
|
||||
|
@ -56,17 +50,13 @@ namespace SourceGit.Commands
|
|||
if (start < rs.StdOut.Length)
|
||||
ParseLine(rs.StdOut.Substring(start));
|
||||
|
||||
if (_result.IsBinary || _result.IsLFS)
|
||||
if (_result.IsBinary || _result.IsLFS || _result.TextDiff.Lines.Count == 0)
|
||||
{
|
||||
_result.TextDiff = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessInlineHighlights();
|
||||
|
||||
if (_result.TextDiff.Lines.Count == 0)
|
||||
_result.TextDiff = null;
|
||||
else
|
||||
_result.TextDiff.MaxLineNumber = Math.Max(_newLine, _oldLine);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue