Ver Fonte

commit: fix `matchUsersWithCommitEmails` (#7561)

Co-authored-by: Joe Chen <[email protected]>
Athanasios Oikonomou há 1 ano atrás
pai
commit
c531da02ca
2 ficheiros alterados com 3 adições e 1 exclusões
  1. 1 0
      CHANGELOG.md
  2. 2 1
      internal/route/repo/commit.go

+ 1 - 0
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
 

+ 2 - 1
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
 		}