From 32bd9e6029e1677cc2b7dd55f92d4743a26f63c7 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 1 Jul 2025 14:25:50 +0200 Subject: [PATCH] Drop stash when successfully unstashing files after moving patch to index --- pkg/commands/git_commands/patch.go | 2 +- .../tests/patch_building/move_to_index_with_modified_file.go | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/commands/git_commands/patch.go b/pkg/commands/git_commands/patch.go index c43dc0561..495d50ad6 100644 --- a/pkg/commands/git_commands/patch.go +++ b/pkg/commands/git_commands/patch.go @@ -259,7 +259,7 @@ func (self *PatchCommands) MovePatchIntoIndex(commits []*models.Commit, commitId } if stash { - if err := self.stash.Apply(0); err != nil { + if err := self.stash.Pop(0); err != nil { return err } } diff --git a/pkg/integration/tests/patch_building/move_to_index_with_modified_file.go b/pkg/integration/tests/patch_building/move_to_index_with_modified_file.go index b9af98d15..93aba6d41 100644 --- a/pkg/integration/tests/patch_building/move_to_index_with_modified_file.go +++ b/pkg/integration/tests/patch_building/move_to_index_with_modified_file.go @@ -54,11 +54,6 @@ var MoveToIndexWithModifiedFile = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Secondary(). Content(Contains("-1\n+11\n")) - /* EXPECTED: t.Views().Stash().IsEmpty() - ACTUAL: */ - t.Views().Stash().Lines( - Contains("Auto-stashing changes"), - ) }, })