diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 11:27:05 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 11:59:45 +1100 |
commit | 036b53acf8234a719fa8e4652527d4781652e050 (patch) | |
tree | 9a557376385417dc56a922a6fd069f88499961d4 /pkg/gui | |
parent | 919463ff02266b6f6f9a0bbf0977b35654845537 (diff) |
in fact we don't need any of these options
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/commits_panel.go | 11 | ||||
-rw-r--r-- | pkg/gui/reflog_panel.go | 8 |
2 files changed, 6 insertions, 13 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 8293d25f0..7876a1a51 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -73,22 +73,19 @@ func (gui *Gui) handleCommitSelect(g *gocui.Gui, v *gocui.View) error { // during startup, the bottleneck is fetching the reflog entries. We need these // on startup to sort the branches by recency. So we have two phases: INITIAL, and COMPLETE. -// In the initial phase we get a small set of reflog entries so that we can ensure -// the first couple of branches are correctly positioned. Then we asynchronously -// refresh the reflog again, without a limit, and refresh the branches again when that's done. -// When we're complete, we can begin recycling reflog entries because we know we've got -// everything down to the oldest entry. +// In the initial phase we don't get any reflog commits, but we asynchronously get them +// and refresh the branches after that func (gui *Gui) refreshReflogCommitsConsideringStartup() { switch gui.State.StartupStage { case INITIAL: go func() { - gui.refreshReflogCommits(refreshReflogOptions{Recycle: false}) + gui.refreshReflogCommits() gui.refreshBranches() gui.State.StartupStage = COMPLETE }() case COMPLETE: - gui.refreshReflogCommits(refreshReflogOptions{Recycle: true}) + gui.refreshReflogCommits() } } diff --git a/pkg/gui/reflog_panel.go b/pkg/gui/reflog_panel.go index f48778948..314509401 100644 --- a/pkg/gui/reflog_panel.go +++ b/pkg/gui/reflog_panel.go @@ -46,17 +46,13 @@ func (gui *Gui) handleReflogCommitSelect(g *gocui.Gui, v *gocui.View) error { return nil } -type refreshReflogOptions struct { - Recycle bool -} - -func (gui *Gui) refreshReflogCommits(options refreshReflogOptions) error { +func (gui *Gui) refreshReflogCommits() error { var lastReflogCommit *commands.Commit if len(gui.State.ReflogCommits) > 0 { lastReflogCommit = gui.State.ReflogCommits[0] } - commits, onlyObtainedNewReflogCommits, err := gui.GitCommand.GetReflogCommits(lastReflogCommit, commands.GetReflogCommitsOptions(options)) + commits, onlyObtainedNewReflogCommits, err := gui.GitCommand.GetReflogCommits(lastReflogCommit) if err != nil { return gui.createErrorPanel(gui.g, err.Error()) } |