From 738189393ed7b586341b0bd6a294a27dade1a0b0 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 9 Jul 2024 15:30:40 +0800 Subject: [PATCH] enhance: refresh working copy changes immediately after discard finished --- src/ViewModels/Discard.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ViewModels/Discard.cs b/src/ViewModels/Discard.cs index 8e25a6cf..368577ff 100644 --- a/src/ViewModels/Discard.cs +++ b/src/ViewModels/Discard.cs @@ -54,19 +54,18 @@ namespace SourceGit.ViewModels return Task.Run(() => { if (_changes == null) - { Commands.Discard.All(_repo.FullPath); - } else if (_isUnstaged) - { Commands.Discard.ChangesInWorkTree(_repo.FullPath, _changes); - } else - { Commands.Discard.ChangesInStaged(_repo.FullPath, _changes); - } - CallUIThread(() => _repo.SetWatcherEnabled(true)); + CallUIThread(() => + { + _repo.MarkWorkingCopyDirtyManually(); + _repo.SetWatcherEnabled(true); + }); + return true; }); }