From 30d4c1008a44077afcf903048e508d85251068e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20W?= <44604769+goran-w@users.noreply.github.com> Date: Sat, 24 May 2025 13:42:10 +0200 Subject: [PATCH] enhance: don't show unmerged files in `STAGED` area (#1359) Unmerged files (i.e unresolved conflicts) should only appear in the Unstaged area, and not "duplicated" in the Staged area. Motivation: * The user-friendly git-status command does not show these as "Changes to be committed". * If they appear in the Staged area, they are quite redundant since the Diff view will just show "No changes or only EOL changes". * Some other Git UIs (like Fork) don't show these as Staged items either. NOTE: According to docs for the git-status "Short Format" (and --porcelain=v1), the XY fields for Unmerged paths do NOT actually represent the Index & Working-tree states, instead they represent the states introduced by each HEAD in the merge (i.e Ours & Theirs, relative to Base). --- src/ViewModels/WorkingCopy.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index a8410eed..1c0e2a74 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -1535,7 +1535,8 @@ namespace SourceGit.ViewModels foreach (var c in _cached) { if (c.Index != Models.ChangeState.None && - c.Index != Models.ChangeState.Untracked) + c.Index != Models.ChangeState.Untracked && + !c.IsConflict) rs.Add(c); } return rs;