Skip to content

Commit 934276a

Browse files
committed
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.
1 parent d99ceb9 commit 934276a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pkg/gui/controllers/undo_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (self *UndoController) reflogRedo() error {
199199
// Though we might support this later, hence the use of the CURRENT_REBASE action kind.
200200
func (self *UndoController) parseReflogForActions(onUserAction func(counter int, action reflogAction) (bool, error)) error {
201201
counter := 0
202-
reflogCommits := self.c.Model().FilteredReflogCommits
202+
reflogCommits := self.c.Model().ReflogCommits
203203
rebaseFinishCommitHash := ""
204204
var action *reflogAction
205205
for reflogCommitIdx, reflogCommit := range reflogCommits {

pkg/gui/types/common.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,11 @@ type Model struct {
289289
Worktrees []*models.Worktree
290290

291291
// FilteredReflogCommits are the ones that appear in the reflog panel.
292-
// when in filtering mode we only include the ones that match the given path
292+
// When in filtering mode we only include the ones that match the given path
293293
FilteredReflogCommits []*models.Commit
294-
// ReflogCommits are the ones used by the branches panel to obtain recency values
295-
// if we're not in filtering mode, CommitFiles and FilteredReflogCommits will be
294+
// ReflogCommits are the ones used by the branches panel to obtain recency values,
295+
// and for the undo functionality.
296+
// If we're not in filtering mode, CommitFiles and FilteredReflogCommits will be
296297
// one and the same
297298
ReflogCommits []*models.Commit
298299

0 commit comments

Comments
 (0)