From 02ca07a9be46d993799e7b91d225d53964759a3c Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 23 Jan 2025 23:12:29 -0800 Subject: [PATCH] Fix incorrect stash diff after rename --- pkg/gui/controllers/stash_controller.go | 4 ++-- pkg/integration/tests/stash/rename.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/gui/controllers/stash_controller.go b/pkg/gui/controllers/stash_controller.go index bc0721b87..f05fd8c9b 100644 --- a/pkg/gui/controllers/stash_controller.go +++ b/pkg/gui/controllers/stash_controller.go @@ -201,13 +201,13 @@ func (self *StashController) handleRenameStashEntry(stashEntry *models.StashEntr HandleConfirm: func(response string) error { self.c.LogAction(self.c.Tr.Actions.RenameStash) err := self.c.Git().Stash.Rename(stashEntry.Index, response) - _ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}}) if err != nil { + _ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}}) return err } self.context().SetSelection(0) // Select the renamed stash self.context().FocusLine() - return nil + return self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}}) }, }) diff --git a/pkg/integration/tests/stash/rename.go b/pkg/integration/tests/stash/rename.go index 4122b3aa8..6653ae3e4 100644 --- a/pkg/integration/tests/stash/rename.go +++ b/pkg/integration/tests/stash/rename.go @@ -31,5 +31,7 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{ t.ExpectPopup().Prompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm() }). SelectedLine(Contains("On master: foo baz")) + + t.Views().Main().Content(Contains("file-1")) }, })