mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Fix incorrect stash diff after rename
This commit is contained in:
@ -201,13 +201,13 @@ func (self *StashController) handleRenameStashEntry(stashEntry *models.StashEntr
|
|||||||
HandleConfirm: func(response string) error {
|
HandleConfirm: func(response string) error {
|
||||||
self.c.LogAction(self.c.Tr.Actions.RenameStash)
|
self.c.LogAction(self.c.Tr.Actions.RenameStash)
|
||||||
err := self.c.Git().Stash.Rename(stashEntry.Index, response)
|
err := self.c.Git().Stash.Rename(stashEntry.Index, response)
|
||||||
_ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
_ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
self.context().SetSelection(0) // Select the renamed stash
|
self.context().SetSelection(0) // Select the renamed stash
|
||||||
self.context().FocusLine()
|
self.context().FocusLine()
|
||||||
return nil
|
return self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -31,5 +31,7 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
t.ExpectPopup().Prompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm()
|
t.ExpectPopup().Prompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm()
|
||||||
}).
|
}).
|
||||||
SelectedLine(Contains("On master: foo baz"))
|
SelectedLine(Contains("On master: foo baz"))
|
||||||
|
|
||||||
|
t.Views().Main().Content(Contains("file-1"))
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user