From a10f9e0dd0747c1c1087934ce9e937b4deaae36c Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 11 Dec 2024 15:27:00 +0800 Subject: [PATCH] enhance: popup will be closed when `cherry-pick` or `revert` failed --- src/ViewModels/CherryPick.cs | 7 +++---- src/ViewModels/Revert.cs | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ViewModels/CherryPick.cs b/src/ViewModels/CherryPick.cs index 19dac059..c3ee07cc 100644 --- a/src/ViewModels/CherryPick.cs +++ b/src/ViewModels/CherryPick.cs @@ -72,10 +72,9 @@ namespace SourceGit.ViewModels return Task.Run(() => { - var succ = false; if (IsMergeCommit) { - succ = new Commands.CherryPick( + new Commands.CherryPick( _repo.FullPath, Targets[0].SHA, !AutoCommit, @@ -84,7 +83,7 @@ namespace SourceGit.ViewModels } else { - succ = new Commands.CherryPick( + new Commands.CherryPick( _repo.FullPath, string.Join(' ', Targets.ConvertAll(c => c.SHA)), !AutoCommit, @@ -93,7 +92,7 @@ namespace SourceGit.ViewModels } CallUIThread(() => _repo.SetWatcherEnabled(true)); - return succ; + return true; }); } diff --git a/src/ViewModels/Revert.cs b/src/ViewModels/Revert.cs index bbe1d9e9..f0eefab1 100644 --- a/src/ViewModels/Revert.cs +++ b/src/ViewModels/Revert.cs @@ -31,9 +31,9 @@ namespace SourceGit.ViewModels return Task.Run(() => { - var succ = new Commands.Revert(_repo.FullPath, Target.SHA, AutoCommit).Exec(); + new Commands.Revert(_repo.FullPath, Target.SHA, AutoCommit).Exec(); CallUIThread(() => _repo.SetWatcherEnabled(true)); - return succ; + return true; }); }