summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation/commits.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/presentation/commits.go')
-rw-r--r--pkg/gui/presentation/commits.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 2a24437c9..c4a02df29 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -30,6 +30,7 @@ func GetCommitListDisplayStrings(
selectedCommitSha string,
startIdx int,
length int,
+ showGraph bool,
) [][]string {
mutex.Lock()
defer mutex.Unlock()
@@ -61,13 +62,20 @@ func GetCommitListDisplayStrings(
end = len(commits) - 1
}
- filteredPipeSets := pipeSets[startIdx : end+1]
filteredCommits := commits[startIdx : end+1]
- graphLines := graph.RenderAux(filteredPipeSets, filteredCommits, selectedCommitSha)
- lines := make([][]string, 0, len(graphLines))
+ var getGraphLine func(int) string
+ if showGraph {
+ filteredPipeSets := pipeSets[startIdx : end+1]
+ graphLines := graph.RenderAux(filteredPipeSets, filteredCommits, selectedCommitSha)
+ getGraphLine = func(idx int) string { return graphLines[idx] }
+ } else {
+ getGraphLine = func(idx int) string { return "" }
+ }
+
+ lines := make([][]string, 0, len(filteredCommits))
for i, commit := range filteredCommits {
- lines = append(lines, displayCommit(commit, cherryPickedCommitShaMap, diffName, parseEmoji, graphLines[i], fullDescription))
+ lines = append(lines, displayCommit(commit, cherryPickedCommitShaMap, diffName, parseEmoji, getGraphLine(i), fullDescription))
}
return lines
}