From 3609d46c1fa7e9b18d301f129fd499023d93c9d4 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 7 Aug 2024 15:59:35 +0800 Subject: [PATCH] enhance: pop stash directly instead of apply+drop --- src/ViewModels/Checkout.cs | 6 +----- src/ViewModels/CheckoutCommit.cs | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/ViewModels/Checkout.cs b/src/ViewModels/Checkout.cs index 87f5a51c..68311b15 100644 --- a/src/ViewModels/Checkout.cs +++ b/src/ViewModels/Checkout.cs @@ -59,11 +59,7 @@ namespace SourceGit.ViewModels if (needPopStash) { SetProgressDescription("Re-apply local changes..."); - rs = new Commands.Stash(_repo.FullPath).Apply("stash@{0}"); - if (rs) - { - rs = new Commands.Stash(_repo.FullPath).Drop("stash@{0}"); - } + rs = new Commands.Stash(_repo.FullPath).Pop("stash@{0}"); } CallUIThread(() => _repo.SetWatcherEnabled(true)); diff --git a/src/ViewModels/CheckoutCommit.cs b/src/ViewModels/CheckoutCommit.cs index 25f809ef..54cdbccd 100644 --- a/src/ViewModels/CheckoutCommit.cs +++ b/src/ViewModels/CheckoutCommit.cs @@ -59,11 +59,7 @@ namespace SourceGit.ViewModels if (needPopStash) { SetProgressDescription("Re-apply local changes..."); - rs = new Commands.Stash(_repo.FullPath).Apply("stash@{0}"); - if (rs) - { - rs = new Commands.Stash(_repo.FullPath).Drop("stash@{0}"); - } + rs = new Commands.Stash(_repo.FullPath).Pop("stash@{0}"); } CallUIThread(() => _repo.SetWatcherEnabled(true));