mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
enhance: use previous state before we get new diff result
This commit is contained in:
parent
635db8b3b3
commit
7c3c022ccc
1 changed files with 12 additions and 1 deletions
|
@ -74,7 +74,13 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
_repo = repo;
|
||||
_option = option;
|
||||
_content = previous != null ? previous._content : null;
|
||||
|
||||
if (previous != null)
|
||||
{
|
||||
_isNoChange = previous._isNoChange;
|
||||
_isTextDiff = previous._isTextDiff;
|
||||
_content = previous._content;
|
||||
}
|
||||
|
||||
OnPropertyChanged(nameof(FilePath));
|
||||
OnPropertyChanged(nameof(IsOrgFilePathVisible));
|
||||
|
@ -107,16 +113,21 @@ namespace SourceGit.ViewModels
|
|||
if (latest.IsBinary)
|
||||
{
|
||||
Content = binaryDiff;
|
||||
IsTextDiff = false;
|
||||
IsNoChange = false;
|
||||
}
|
||||
else if (latest.IsLFS)
|
||||
{
|
||||
Content = latest.LFSDiff;
|
||||
IsTextDiff = false;
|
||||
IsNoChange = false;
|
||||
}
|
||||
else if (latest.TextDiff != null)
|
||||
{
|
||||
latest.TextDiff.File = _option.Path;
|
||||
Content = latest.TextDiff;
|
||||
IsTextDiff = true;
|
||||
IsNoChange = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue