summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-05-08 14:23:29 +1000
committerJesse Duffield <jessedduffield@gmail.com>2022-05-08 14:26:18 +1000
commite67fef776bbc52626fb9551b3292a615b44bfacb (patch)
treed4ee753c6cc6c2a638d8f0abfe8b6aeadd7a34ae /pkg/gui/presentation
parent6f8063217ddf132dca36b75affaa7f7273f89d9d (diff)
add author email to commits
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/commits.go4
-rw-r--r--pkg/gui/presentation/graph/graph_test.go8
2 files changed, 6 insertions, 6 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 59802dabf..693b46337 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -156,7 +156,7 @@ func loadPipesets(commits []*models.Commit) [][]*graph.Pipe {
// pipe sets are unique to a commit head. and a commit count. Sometimes we haven't loaded everything for that.
// so let's just cache it based on that.
getStyle := func(commit *models.Commit) style.TextStyle {
- return authors.AuthorStyle(commit.Author)
+ return authors.AuthorStyle(commit.AuthorName)
}
pipeSets = graph.GetPipeSets(commits, getStyle)
pipeSetCache[cacheKey] = pipeSets
@@ -288,7 +288,7 @@ func displayCommit(
cols = append(
cols,
actionString,
- authorFunc(commit.Author),
+ authorFunc(commit.AuthorName),
graphLine+tagString+theme.DefaultTextColor.Sprint(name),
)
diff --git a/pkg/gui/presentation/graph/graph_test.go b/pkg/gui/presentation/graph/graph_test.go
index 300042558..a6c60acf5 100644
--- a/pkg/gui/presentation/graph/graph_test.go
+++ b/pkg/gui/presentation/graph/graph_test.go
@@ -528,7 +528,7 @@ func TestGetNextPipes(t *testing.T) {
func BenchmarkRenderCommitGraph(b *testing.B) {
commits := generateCommits(50)
getStyle := func(commit *models.Commit) style.TextStyle {
- return authors.AuthorStyle(commit.Author)
+ return authors.AuthorStyle(commit.AuthorName)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -538,7 +538,7 @@ func BenchmarkRenderCommitGraph(b *testing.B) {
func generateCommits(count int) []*models.Commit {
rand.Seed(1234)
- pool := []*models.Commit{{Sha: "a", Author: "A"}}
+ pool := []*models.Commit{{Sha: "a", AuthorName: "A"}}
commits := make([]*models.Commit, 0, count)
authorPool := []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
for len(commits) < count {
@@ -555,8 +555,8 @@ func generateCommits(count int) []*models.Commit {
newParent = pool[j]
} else {
newParent = &models.Commit{
- Sha: fmt.Sprintf("%s%d", currentCommit.Sha, j),
- Author: authorPool[rand.Intn(len(authorPool))],
+ Sha: fmt.Sprintf("%s%d", currentCommit.Sha, j),
+ AuthorName: authorPool[rand.Intn(len(authorPool))],
}
pool = append(pool, newParent)
}