From 08f279a521ab745aaebbee9df8cb3775c51cf391 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 8 May 2021 09:48:53 +0800 Subject: [PATCH] fix: unselect items before checking conflicts --- src/Views/Widgets/WorkingCopy.xaml.cs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Views/Widgets/WorkingCopy.xaml.cs b/src/Views/Widgets/WorkingCopy.xaml.cs index 15bfb47a..5c0b8843 100644 --- a/src/Views/Widgets/WorkingCopy.xaml.cs +++ b/src/Views/Widgets/WorkingCopy.xaml.cs @@ -112,25 +112,21 @@ namespace SourceGit.Views.Widgets { return; } + if (container.IsUnstaged) { + stagedContainer.UnselectAll(); + } else { + unstagedContainer.UnselectAll(); + } + var change = e.Target; if (change.IsConflit) { mergePanel.Visibility = Visibility.Visible; + diffViewer.Reset(); return; } mergePanel.Visibility = Visibility.Collapsed; - - if (!container.IsUnstaged) { - unstagedContainer.UnselectAll(); - - diffViewer.Diff(repo.Path, new DiffViewer.Option() { - ExtraArgs = "--cached", - Path = change.Path, - OrgPath = change.OriginalPath - }); - } else { - stagedContainer.UnselectAll(); - + if (container.IsUnstaged) { switch (change.WorkTree) { case Models.Change.Status.Added: case Models.Change.Status.Untracked: @@ -147,6 +143,12 @@ namespace SourceGit.Views.Widgets { }); break; } + } else { + diffViewer.Diff(repo.Path, new DiffViewer.Option() { + ExtraArgs = "--cached", + Path = change.Path, + OrgPath = change.OriginalPath + }); } } #endregion