Skip to content

Commit

Permalink
Fix incorrect stash diff after rename
Browse files Browse the repository at this point in the history
  • Loading branch information
brandondong committed Jan 25, 2025
1 parent 40d6800 commit 66a60f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/gui/controllers/stash_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}})
},
})

Expand Down
2 changes: 2 additions & 0 deletions pkg/integration/tests/stash/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
},
})

0 comments on commit 66a60f3

Please sign in to comment.