refactor: code cleanup

This commit is contained in:
leo 2024-05-30 15:13:59 +08:00
parent 04f4293421
commit fa3a3b2dad
25 changed files with 174 additions and 233 deletions

View file

@ -158,13 +158,6 @@ namespace SourceGit.ViewModels
get => _stashesPage == null ? 0 : _stashesPage.Count;
}
[JsonIgnore]
public bool CanCommitWithPush
{
get => _canCommitWithPush;
private set => SetProperty(ref _canCommitWithPush, value);
}
[JsonIgnore]
public bool IncludeUntracked
{
@ -172,9 +165,7 @@ namespace SourceGit.ViewModels
set
{
if (SetProperty(ref _includeUntracked, value))
{
Task.Run(RefreshWorkingCopyChanges);
}
}
}
@ -567,8 +558,11 @@ namespace SourceGit.ViewModels
LocalBranchTrees = builder.Locals;
RemoteBranchTrees = builder.Remotes;
var cur = Branches.Find(x => x.IsCurrent);
CanCommitWithPush = cur != null && !string.IsNullOrEmpty(cur.Upstream);
if (_workingCopy != null)
{
var cur = Branches.Find(x => x.IsCurrent);
_workingCopy.CanCommitWithPush = cur != null && !string.IsNullOrEmpty(cur.Upstream);
}
});
}
@ -1520,7 +1514,6 @@ namespace SourceGit.ViewModels
private List<BranchTreeNode> _remoteBranchTrees = new List<BranchTreeNode>();
private List<Models.Tag> _tags = new List<Models.Tag>();
private List<string> _submodules = new List<string>();
private bool _canCommitWithPush = false;
private bool _includeUntracked = true;
private InProgressContext _inProgressContext = null;