1
0
Jelajahi Sumber

fix not giving user value to first commit in repo/commit.go

jerryliao 2 tahun lalu
induk
melakukan
3a7aa2c00c
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      internal/route/repo/commit.go

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