mirror of
https://github.com/go-gitea/gitea.git
synced 2025-02-20 11:43:57 +08:00
Compare commits
4 Commits
61a465b077
...
eb28adadea
Author | SHA1 | Date | |
---|---|---|---|
|
eb28adadea | ||
|
21af8150b7 | ||
|
40faa6dc78 | ||
|
d7d01946ae |
@ -43,9 +43,11 @@ func (au *AvatarUtils) Avatar(item any, others ...any) template.HTML {
|
||||
|
||||
switch t := item.(type) {
|
||||
case *user_model.User:
|
||||
src := t.AvatarLinkWithSize(au.ctx, size*setting.Avatar.RenderedSizeFactor)
|
||||
if src != "" {
|
||||
return AvatarHTML(src, size, class, t.DisplayName())
|
||||
if t != nil && t.ID != 0 {
|
||||
src := t.AvatarLinkWithSize(au.ctx, size*setting.Avatar.RenderedSizeFactor)
|
||||
if src != "" {
|
||||
return AvatarHTML(src, size, class, t.DisplayName())
|
||||
}
|
||||
}
|
||||
case *repo_model.Collaborator:
|
||||
src := t.AvatarLinkWithSize(au.ctx, size*setting.Avatar.RenderedSizeFactor)
|
||||
|
@ -1701,7 +1701,9 @@ issues.time_estimate_invalid=O formato da estimativa de tempo é inválido
|
||||
issues.start_tracking_history=começou a trabalhar %s
|
||||
issues.tracker_auto_close=O cronómetro será parado automaticamente quando esta questão for fechada
|
||||
issues.tracking_already_started=`Você já iniciou a contagem de tempo <a href="%s">noutra questão</a>!`
|
||||
issues.stop_tracking=Parar cronómetro
|
||||
issues.stop_tracking_history=trabalhou durante <b>%[1]s</b> %[2]s
|
||||
issues.cancel_tracking=Descartar
|
||||
issues.cancel_tracking_history=`cancelou a contagem de tempo %s`
|
||||
issues.del_time=Eliminar este registo de tempo
|
||||
issues.add_time_history=adicionou <b>%[1]s</b> de tempo gasto %[2]s
|
||||
|
@ -5,6 +5,7 @@ package git
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
@ -18,9 +19,6 @@ import (
|
||||
|
||||
// ParseCommitsWithSignature checks if signaute of commits are corresponding to users gpg keys.
|
||||
func ParseCommitsWithSignature(ctx context.Context, oldCommits []*user_model.UserCommit, repoTrustModel repo_model.TrustModelType, isOwnerMemberCollaborator func(*user_model.User) (bool, error)) ([]*asymkey_model.SignCommit, error) {
|
||||
newCommits := make([]*asymkey_model.SignCommit, 0, len(oldCommits))
|
||||
keyMap := map[string]bool{}
|
||||
|
||||
emails := make(container.Set[string])
|
||||
for _, c := range oldCommits {
|
||||
if c.Committer != nil {
|
||||
@ -33,6 +31,9 @@ func ParseCommitsWithSignature(ctx context.Context, oldCommits []*user_model.Use
|
||||
return nil, err
|
||||
}
|
||||
|
||||
newCommits := make([]*asymkey_model.SignCommit, 0, len(oldCommits))
|
||||
keyMap := map[string]bool{}
|
||||
cachedVerifications := make(map[string]*asymkey_model.CommitVerification)
|
||||
for _, c := range oldCommits {
|
||||
committer, ok := emailUsers[c.Committer.Email]
|
||||
if !ok && c.Committer != nil {
|
||||
@ -42,9 +43,19 @@ func ParseCommitsWithSignature(ctx context.Context, oldCommits []*user_model.Use
|
||||
}
|
||||
}
|
||||
|
||||
key := committer.Email
|
||||
if c.Signature != nil {
|
||||
key += fmt.Sprintf("-%s", c.Signature.Signature)
|
||||
}
|
||||
verification, ok := cachedVerifications[key]
|
||||
if !ok {
|
||||
verification = asymkey_service.ParseCommitWithSignatureCommitter(ctx, c.Commit, committer)
|
||||
cachedVerifications[key] = verification
|
||||
}
|
||||
|
||||
signCommit := &asymkey_model.SignCommit{
|
||||
UserCommit: c,
|
||||
Verification: asymkey_service.ParseCommitWithSignatureCommitter(ctx, c.Commit, committer),
|
||||
Verification: verification,
|
||||
}
|
||||
|
||||
_ = asymkey_model.CalculateTrustStatus(signCommit.Verification, repoTrustModel, isOwnerMemberCollaborator, &keyMap)
|
||||
|
@ -29,7 +29,7 @@ func GetCommitGraph(r *git.Repository, page, maxAllowedColors int, hidePRRefs bo
|
||||
}
|
||||
|
||||
if len(branches) == 0 {
|
||||
graphCmd.AddArguments("--all")
|
||||
graphCmd.AddArguments("--tags", "--branches")
|
||||
}
|
||||
|
||||
graphCmd.AddArguments("-C", "-M", "--date=iso-strict").
|
||||
|
Loading…
x
Reference in New Issue
Block a user