summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-26 21:11:21 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-26 21:44:33 +1100
commit91a404d0331132d3aac463a4e77a7c73b81c5961 (patch)
treef9d177489f39185b2a17eade253f58426f39c44c /pkg/gui/presentation
parentd027cf969c56f3dcf8bc3ddd73e09f5ba975677f (diff)
separate commits from cherry pick state
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/commits.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 00b8e7f34..dedf4a01b 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -9,10 +9,10 @@ import (
"github.com/jesseduffield/lazygit/pkg/utils"
)
-func GetCommitListDisplayStrings(commits []*commands.Commit, fullDescription bool) [][]string {
+func GetCommitListDisplayStrings(commits []*commands.Commit, fullDescription bool, cherryPickedCommitShaMap map[string]bool) [][]string {
lines := make([][]string, len(commits))
- var displayFunc func(*commands.Commit) []string
+ var displayFunc func(*commands.Commit, map[string]bool) []string
if fullDescription {
displayFunc = getFullDescriptionDisplayStringsForCommit
} else {
@@ -20,13 +20,13 @@ func GetCommitListDisplayStrings(commits []*commands.Commit, fullDescription boo
}
for i := range commits {
- lines[i] = displayFunc(commits[i])
+ lines[i] = displayFunc(commits[i], cherryPickedCommitShaMap)
}
return lines
}
-func getFullDescriptionDisplayStringsForCommit(c *commands.Commit) []string {
+func getFullDescriptionDisplayStringsForCommit(c *commands.Commit, cherryPickedCommitShaMap map[string]bool) []string {
red := color.New(color.FgRed)
yellow := color.New(color.FgYellow)
green := color.New(color.FgGreen)
@@ -58,7 +58,7 @@ func getFullDescriptionDisplayStringsForCommit(c *commands.Commit) []string {
shaColor = defaultColor
}
- if c.Copied {
+ if cherryPickedCommitShaMap[c.Sha] {
shaColor = copied
}
@@ -77,7 +77,7 @@ func getFullDescriptionDisplayStringsForCommit(c *commands.Commit) []string {
return []string{shaColor.Sprint(c.ShortSha()), secondColumnString, yellow.Sprint(truncatedAuthor), tagString + defaultColor.Sprint(c.Name)}
}
-func getDisplayStringsForCommit(c *commands.Commit) []string {
+func getDisplayStringsForCommit(c *commands.Commit, cherryPickedCommitShaMap map[string]bool) []string {
red := color.New(color.FgRed)
yellow := color.New(color.FgYellow)
green := color.New(color.FgGreen)
@@ -109,7 +109,7 @@ func getDisplayStringsForCommit(c *commands.Commit) []string {
shaColor = defaultColor
}
- if c.Copied {
+ if cherryPickedCommitShaMap[c.Sha] {
shaColor = copied
}