summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-26 09:18:52 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-26 18:30:02 +1100
commit37acc17cf3dc7df94aef5ee5a2c62763ea655bf2 (patch)
tree9068aa4ea52e4eaac020ea2d468f4b3b8ce41cd1 /pkg/gui/presentation
parent569ec5919cc1801783082d326d279f153fc806c8 (diff)
more lenient getting of short shas
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/commits.go4
-rw-r--r--pkg/gui/presentation/reflog_commits.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 740abab78..00b8e7f34 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -74,7 +74,7 @@ func getFullDescriptionDisplayStringsForCommit(c *commands.Commit) []string {
truncatedAuthor := utils.TruncateWithEllipsis(c.Author, 17)
- return []string{shaColor.Sprint(c.Sha[:8]), secondColumnString, yellow.Sprint(truncatedAuthor), tagString + defaultColor.Sprint(c.Name)}
+ return []string{shaColor.Sprint(c.ShortSha()), secondColumnString, yellow.Sprint(truncatedAuthor), tagString + defaultColor.Sprint(c.Name)}
}
func getDisplayStringsForCommit(c *commands.Commit) []string {
@@ -122,5 +122,5 @@ func getDisplayStringsForCommit(c *commands.Commit) []string {
tagString = utils.ColoredStringDirect(strings.Join(c.Tags, " "), tagColor) + " "
}
- return []string{shaColor.Sprint(c.Sha[:8]), actionString + tagString + defaultColor.Sprint(c.Name)}
+ return []string{shaColor.Sprint(c.ShortSha()), actionString + tagString + defaultColor.Sprint(c.Name)}
}
diff --git a/pkg/gui/presentation/reflog_commits.go b/pkg/gui/presentation/reflog_commits.go
index 9ec325fb3..a3e39a70d 100644
--- a/pkg/gui/presentation/reflog_commits.go
+++ b/pkg/gui/presentation/reflog_commits.go
@@ -27,11 +27,11 @@ func GetReflogCommitListDisplayStrings(commits []*commands.Commit, fullDescripti
func getFullDescriptionDisplayStringsForReflogCommit(c *commands.Commit) []string {
defaultColor := color.New(theme.DefaultTextColor)
- return []string{utils.ColoredString(c.Sha[:8], color.FgBlue), utils.ColoredString(c.Date, color.FgMagenta), defaultColor.Sprint(c.Name)}
+ return []string{utils.ColoredString(c.ShortSha(), color.FgBlue), utils.ColoredString(c.Date, color.FgMagenta), defaultColor.Sprint(c.Name)}
}
func getDisplayStringsForReflogCommit(c *commands.Commit) []string {
defaultColor := color.New(theme.DefaultTextColor)
- return []string{utils.ColoredString(c.Sha[:8], color.FgBlue), defaultColor.Sprint(c.Name)}
+ return []string{utils.ColoredString(c.ShortSha(), color.FgBlue), defaultColor.Sprint(c.Name)}
}