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()
|
public Models.DiffResult Result()
|
||||||
{
|
{
|
||||||
var rs = ReadToEnd();
|
var rs = ReadToEnd();
|
||||||
if (!rs.IsSuccess)
|
|
||||||
{
|
|
||||||
_result.TextDiff = null;
|
|
||||||
return _result;
|
|
||||||
}
|
|
||||||
|
|
||||||
var start = 0;
|
var start = 0;
|
||||||
var end = rs.StdOut.IndexOf('\n', start);
|
var end = rs.StdOut.IndexOf('\n', start);
|
||||||
while (end > 0)
|
while (end > 0)
|
||||||
|
@ -56,19 +50,15 @@ namespace SourceGit.Commands
|
||||||
if (start < rs.StdOut.Length)
|
if (start < rs.StdOut.Length)
|
||||||
ParseLine(rs.StdOut.Substring(start));
|
ParseLine(rs.StdOut.Substring(start));
|
||||||
|
|
||||||
if (_result.IsBinary || _result.IsLFS)
|
if (_result.IsBinary || _result.IsLFS || _result.TextDiff.Lines.Count == 0)
|
||||||
{
|
{
|
||||||
_result.TextDiff = null;
|
_result.TextDiff = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ProcessInlineHighlights();
|
ProcessInlineHighlights();
|
||||||
|
_result.TextDiff.MaxLineNumber = Math.Max(_newLine, _oldLine);
|
||||||
if (_result.TextDiff.Lines.Count == 0)
|
}
|
||||||
_result.TextDiff = null;
|
|
||||||
else
|
|
||||||
_result.TextDiff.MaxLineNumber = Math.Max(_newLine, _oldLine);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue