summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-29 10:52:01 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-29 11:37:29 +1100
commitaa750c08192d9d19c32bd4a6125cdcd9bd66595f (patch)
tree96bcf196c390b1262f7eae55123ba917694b7d10 /pkg
parentd90d9d7330ff5ba5161c70d6b8e11cb7b87c9b47 (diff)
load reflog commits manually when in filter mode for branches panel
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/branches_panel.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go
index c7cba8aea..624b529e5 100644
--- a/pkg/gui/branches_panel.go
+++ b/pkg/gui/branches_panel.go
@@ -54,7 +54,20 @@ func (gui *Gui) handleBranchSelect(g *gocui.Gui, v *gocui.View) error {
// gui.refreshStatus is called at the end of this because that's when we can
// be sure there is a state.Branches array to pick the current branch from
func (gui *Gui) refreshBranches() {
- builder, err := commands.NewBranchListBuilder(gui.Log, gui.GitCommand, gui.State.ReflogCommits)
+ reflogCommits := gui.State.ReflogCommits
+ if gui.inFilterMode() {
+ // in filter mode we filter our reflog commits to just those containing the path
+ // however we need all the reflog entries to populate the recencies of our branches
+ // which allows us to order them correctly. So if we're filtering we'll just
+ // manually load all the reflog commits here
+ var err error
+ reflogCommits, _, err = gui.GitCommand.GetReflogCommits(nil, "")
+ if err != nil {
+ gui.Log.Error(err)
+ }
+ }
+
+ builder, err := commands.NewBranchListBuilder(gui.Log, gui.GitCommand, reflogCommits)
if err != nil {
_ = gui.surfaceError(err)
}