Skip to content

Commit

Permalink
fixup! Show divergence from base branch in branches list
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaller committed May 31, 2024
1 parent fc4204f commit c6113f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pkg/commands/git_commands/branch_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewBranchLoader(

// Load the list of branches for the current repo
func (self *BranchLoader) Load(reflogCommits []*models.Commit,
existingMainBranches *ExistingMainBranches,
mainBranches *MainBranches,
oldBranches []*models.Branch,
loadBehindCounts bool,
onWorker func(func() error),
Expand Down Expand Up @@ -142,7 +142,7 @@ func (self *BranchLoader) Load(reflogCommits []*models.Commit,

if loadBehindCounts && self.UserConfig.Gui.ShowDivergenceFromBaseBranch != "none" {
onWorker(func() error {
return self.GetBehindBaseBranchValuesForAllBranches(branches, existingMainBranches, renderFunc)
return self.GetBehindBaseBranchValuesForAllBranches(branches, mainBranches, renderFunc)
})
}

Expand All @@ -151,11 +151,11 @@ func (self *BranchLoader) Load(reflogCommits []*models.Commit,

func (self *BranchLoader) GetBehindBaseBranchValuesForAllBranches(
branches []*models.Branch,
existingMainBranches *ExistingMainBranches,
mainBranches *MainBranches,
renderFunc func(),
) error {
mainBranches := existingMainBranches.Get()
if len(mainBranches) == 0 {
mainBranchRefs := mainBranches.Get()
if len(mainBranchRefs) == 0 {
return nil
}

Expand All @@ -164,7 +164,7 @@ func (self *BranchLoader) GetBehindBaseBranchValuesForAllBranches(

for _, branch := range branches {
errg.Go(func() error {
baseBranch, err := self.GetBaseBranch(branch, existingMainBranches)
baseBranch, err := self.GetBaseBranch(branch, mainBranches)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/helpers/refresh_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func (self *RefreshHelper) refreshBranches(refreshWorktrees bool, keepBranchSele

branches, err := self.c.Git().Loaders.BranchLoader.Load(
reflogCommits,
self.c.Model().ExistingMainBranches,
self.c.Model().MainBranches,
self.c.Model().Branches,
loadBehindCounts,
func(f func() error) {
Expand Down

0 comments on commit c6113f6

Please sign in to comment.