diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-26 21:12:40 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-26 21:44:33 +1100 |
commit | f2036b42e53e1fc647f431e08e078e5c96bc4352 (patch) | |
tree | 9383b7f76b57cb72263c61a3f5922a4b1de1c5a1 /pkg/gui | |
parent | 21b7d4184535e1132c828c379c7125ecd100e02a (diff) |
only load new reflog entries
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/reflog_panel.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/gui/reflog_panel.go b/pkg/gui/reflog_panel.go index fd26a67c8..199d9337f 100644 --- a/pkg/gui/reflog_panel.go +++ b/pkg/gui/reflog_panel.go @@ -47,12 +47,17 @@ func (gui *Gui) handleReflogCommitSelect(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) refreshReflogCommits() error { - commits, err := gui.GitCommand.GetReflogCommits() + var lastReflogCommit *commands.Commit + if len(gui.State.ReflogCommits) > 0 { + lastReflogCommit = gui.State.ReflogCommits[0] + } + + commits, err := gui.GitCommand.GetNewReflogCommits(lastReflogCommit) if err != nil { return gui.createErrorPanel(gui.g, err.Error()) } - gui.State.ReflogCommits = commits + gui.State.ReflogCommits = append(commits, gui.State.ReflogCommits...) if gui.getCommitsView().Context == "reflog-commits" { return gui.renderReflogCommitsWithSelection() |