From 6613566afb3baba29ba7e751112fb047cae07727 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 8 May 2021 10:08:57 +0800 Subject: [PATCH] optimize: do NOT show unmerged changes in staged --- src/Models/Change.cs | 7 ------- src/Views/Controls/ChangeStatusIcon.cs | 2 +- src/Views/Widgets/WorkingCopy.xaml.cs | 5 ++++- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Models/Change.cs b/src/Models/Change.cs index 36a32e54..2bfc2c91 100644 --- a/src/Models/Change.cs +++ b/src/Models/Change.cs @@ -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; diff --git a/src/Views/Controls/ChangeStatusIcon.cs b/src/Views/Controls/ChangeStatusIcon.cs index be247693..be1e3e55 100644 --- a/src/Views/Controls/ChangeStatusIcon.cs +++ b/src/Views/Controls/ChangeStatusIcon.cs @@ -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 "?"; } diff --git a/src/Views/Widgets/WorkingCopy.xaml.cs b/src/Views/Widgets/WorkingCopy.xaml.cs index 5c0b8843..4173a812 100644 --- a/src/Views/Widgets/WorkingCopy.xaml.cs +++ b/src/Views/Widgets/WorkingCopy.xaml.cs @@ -28,7 +28,10 @@ namespace SourceGit.Views.Widgets { List stagedChanges = new List(); 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); }