From c531da02caa5ec15279718e1ba045b61e47561a8 Mon Sep 17 00:00:00 2001 From: Athanasios Oikonomou Date: Wed, 1 Nov 2023 17:58:48 +0200 Subject: [PATCH] commit: fix `matchUsersWithCommitEmails` (#7561) Co-authored-by: Joe Chen --- CHANGELOG.md | 1 + internal/route/repo/commit.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c543f8d1..9d4d2866c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to Gogs are documented in this file. ### Fixed - Submodules using `ssh://` protocol and a port number are not rendered correctly. [#4941](https://github.com/gogs/gogs/issues/4941) +- Missing link to user profile on the first commit in commits history page. [#7404](https://github.com/gogs/gogs/issues/7404) ## 0.13.0 diff --git a/internal/route/repo/commit.go b/internal/route/repo/commit.go index f82336d97..b2be6d5bf 100644 --- a/internal/route/repo/commit.go +++ b/internal/route/repo/commit.go @@ -200,7 +200,8 @@ func matchUsersWithCommitEmails(ctx gocontext.Context, oldCommits []*git.Commit) for i := range oldCommits { var u *db.User if v, ok := emailToUsers[oldCommits[i].Author.Email]; !ok { - emailToUsers[oldCommits[i].Author.Email], _ = db.Users.GetByEmail(ctx, oldCommits[i].Author.Email) + u, _ = db.Users.GetByEmail(ctx, oldCommits[i].Author.Email) + emailToUsers[oldCommits[i].Author.Email] = u } else { u = v }