From 84ac77971b79a908e0ef10de0a3cbc1805901d7d Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 28 Oct 2022 09:57:50 +0800 Subject: [PATCH] optimize: do not re-diff when file not changed --- src/Views/Widgets/DiffViewer.xaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Views/Widgets/DiffViewer.xaml.cs b/src/Views/Widgets/DiffViewer.xaml.cs index 33871fff..0bb091ec 100644 --- a/src/Views/Widgets/DiffViewer.xaml.cs +++ b/src/Views/Widgets/DiffViewer.xaml.cs @@ -69,7 +69,9 @@ namespace SourceGit.Views.Widgets { if (wcFileID == lastWCFileId) return; lastWCFileId = wcFileID; } else { - lastWCFileId = ""; + var wcFileID = string.Format("{0}@-1", opt.Path); + if (wcFileID == lastWCFileId) return; + lastWCFileId = wcFileID; } } else { lastWCFileId = "";