0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-04 22:57:34 -04:00

Update models/repo/language_stats.go

Signed-off-by: silverwind <me@silverwind.io>
This commit is contained in:
silverwind 2025-07-04 17:07:37 +02:00 committed by GitHub
parent 573b40d2d5
commit f52fd7091e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -167,7 +167,7 @@ func UpdateLanguageStats(ctx context.Context, repo *Repository, commitID string,
// Update already existing language
if strings.EqualFold(s.Language, lang) {
s.CommitID = commitID
s.IsPrimary = strings.EqualFold(lang, topLang)
s.IsPrimary = lang == topLang
s.Size = size
if _, err := sess.ID(s.ID).Cols("`commit_id`", "`size`", "`is_primary`").Update(s); err != nil {
return err