1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Use the non-filtered reflog for undoing

Using the filtered one is probably not a good idea. It didn't do much harm
because the split of ReflogCommits and FilteredReflogCommits doesn't really work
right now (FilteredReflogCommits is always the same as ReflogCommits, even in
filtering mode), but we'll fix this in the next commit.
This commit is contained in:
Stefan Haller
2025-07-10 14:00:01 +02:00
parent d99ceb91ee
commit 934276ac40
2 changed files with 5 additions and 4 deletions

View File

@ -199,7 +199,7 @@ func (self *UndoController) reflogRedo() error {
// Though we might support this later, hence the use of the CURRENT_REBASE action kind. // Though we might support this later, hence the use of the CURRENT_REBASE action kind.
func (self *UndoController) parseReflogForActions(onUserAction func(counter int, action reflogAction) (bool, error)) error { func (self *UndoController) parseReflogForActions(onUserAction func(counter int, action reflogAction) (bool, error)) error {
counter := 0 counter := 0
reflogCommits := self.c.Model().FilteredReflogCommits reflogCommits := self.c.Model().ReflogCommits
rebaseFinishCommitHash := "" rebaseFinishCommitHash := ""
var action *reflogAction var action *reflogAction
for reflogCommitIdx, reflogCommit := range reflogCommits { for reflogCommitIdx, reflogCommit := range reflogCommits {

View File

@ -289,10 +289,11 @@ type Model struct {
Worktrees []*models.Worktree Worktrees []*models.Worktree
// FilteredReflogCommits are the ones that appear in the reflog panel. // FilteredReflogCommits are the ones that appear in the reflog panel.
// when in filtering mode we only include the ones that match the given path // When in filtering mode we only include the ones that match the given path
FilteredReflogCommits []*models.Commit FilteredReflogCommits []*models.Commit
// ReflogCommits are the ones used by the branches panel to obtain recency values // ReflogCommits are the ones used by the branches panel to obtain recency values,
// if we're not in filtering mode, CommitFiles and FilteredReflogCommits will be // and for the undo functionality.
// If we're not in filtering mode, CommitFiles and FilteredReflogCommits will be
// one and the same // one and the same
ReflogCommits []*models.Commit ReflogCommits []*models.Commit