optimize<WorkingCopy>: do NOT show unmerged changes in staged

This commit is contained in:
leo 2021-05-08 10:08:57 +08:00
parent 08f279a521
commit 6613566afb
3 changed files with 5 additions and 9 deletions

View file

@ -33,13 +33,6 @@ namespace SourceGit.Models {
public string Path { get; set; } = "";
public string OriginalPath { get; set; } = "";
public bool IsAddedToIndex {
get {
if (Index == Status.None || Index == Status.Untracked) return false;
return true;
}
}
public bool IsConflit {
get {
if (Index == Status.Unmerged || WorkTree == Status.Unmerged) return true;

View file

@ -102,7 +102,7 @@ namespace SourceGit.Views.Controls {
case Models.Change.Status.Deleted: return "▬";
case Models.Change.Status.Renamed: return "➔";
case Models.Change.Status.Copied: return "❏";
case Models.Change.Status.Unmerged: return "";
case Models.Change.Status.Unmerged: return "U";
case Models.Change.Status.Untracked: return "★";
default: return "?";
}

View file

@ -28,7 +28,10 @@ namespace SourceGit.Views.Widgets {
List<Models.Change> stagedChanges = new List<Models.Change>();
foreach (var c in changes) {
if (c.IsAddedToIndex) {
if (c.Index == Models.Change.Status.Modified
|| c.Index == Models.Change.Status.Added
|| c.Index == Models.Change.Status.Deleted
|| c.Index == Models.Change.Status.Renamed) {
stagedChanges.Add(c);
}