aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAthanasios Oikonomou <athoik@gmail.com>2023-11-01 17:58:48 +0200
committerGitHub <noreply@github.com>2023-11-01 11:58:48 -0400
commitc531da02caa5ec15279718e1ba045b61e47561a8 (patch)
tree73cdb319577e95e4b1b5d6cb808e5ac4fdba74af
parentbc1b5e52a9961ba975019e326f7ab80d30ffcb9b (diff)
commit: fix `matchUsersWithCommitEmails` (#7561)
Co-authored-by: Joe Chen <jc@unknwon.io>
-rw-r--r--CHANGELOG.md1
-rw-r--r--internal/route/repo/commit.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9c543f8d..9d4d2866 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 f82336d9..b2be6d5b 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
}