Skip to content

Commit 12f4151

Browse files
committed
fixup! Visualize local branch heads in commits panel
1 parent 64c448c commit 12f4151

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/gui/presentation/commits.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ func GetCommitListDisplayStrings(
106106
// that are not the current branch, and not any of the main branches. The
107107
// goal is to visualize stacks of local branches, so anything that doesn't
108108
// contribute to a branch stack shouldn't show a marker.
109-
branchHeadsToVisualize := lo.FilterMap(branches,
109+
branchHeadsToVisualize := lo.SliceToMap(lo.FilterMap(branches,
110110
func(b *models.Branch, index int) (string, bool) {
111111
return b.CommitHash,
112112
// Don't show a marker for the current branch
113113
b.Name != currentBranchName &&
114114
// Don't show a marker for main branches
115115
!lo.Contains(common.UserConfig.Git.MainBranches, b.Name)
116-
})
116+
}), func(s string) (string, struct{}) { return s, struct{}{} })
117117

118118
lines := make([][]string, 0, len(filteredCommits))
119119
var bisectStatus BisectStatus
@@ -277,7 +277,7 @@ func getBisectStatusText(bisectStatus BisectStatus, bisectInfo *git_commands.Bis
277277
func displayCommit(
278278
common *common.Common,
279279
commit *models.Commit,
280-
branchHeadsToVisualize []string,
280+
branchHeadsToVisualize map[string]struct{},
281281
cherryPickedCommitShaSet *set.Set[string],
282282
diffName string,
283283
timeFormat string,
@@ -307,7 +307,7 @@ func displayCommit(
307307
} else {
308308
if len(commit.Tags) > 0 {
309309
tagString = theme.DiffTerminalColor.SetBold().Sprint(strings.Join(commit.Tags, " ")) + " "
310-
} else if lo.Contains(branchHeadsToVisualize, commit.Sha) && commit.Status != models.StatusMerged {
310+
} else if _, found := branchHeadsToVisualize[commit.Sha]; found && commit.Status != models.StatusMerged {
311311
tagString = style.FgCyan.SetBold().Sprint(
312312
lo.Ternary(icons.IsIconEnabled(), icons.BRANCH_ICON, "*") + " ")
313313
}

0 commit comments

Comments
 (0)