|
|
@@ -7,8 +7,8 @@ package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
"code.gitea.io/gitea/modules/options" |
|
|
|
"encoding/base64" |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
gotemplate "html/template" |
|
|
|
"io/ioutil" |
|
|
@@ -29,6 +29,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/lfs" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/markup" |
|
|
|
"code.gitea.io/gitea/modules/options" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
) |
|
|
|
|
|
|
@@ -343,6 +344,11 @@ func renderDirectory(ctx *context.Context, treeLink string) { |
|
|
|
// Show latest commit info of repository in table header, |
|
|
|
// or of directory if not in root directory. |
|
|
|
ctx.Data["LatestCommit"] = latestCommit |
|
|
|
|
|
|
|
latestCommitJson, _ := json.Marshal(latestCommit) |
|
|
|
//log.Info(accuracyJson=” + string(accuracyJson)) |
|
|
|
log.Info("latestCommitJson=" + string(latestCommitJson)) |
|
|
|
|
|
|
|
verification := models.ParseCommitWithSignature(latestCommit) |
|
|
|
|
|
|
|
if err := models.CalculateTrustStatus(verification, ctx.Repo.Repository, nil); err != nil { |
|
|
@@ -578,11 +584,11 @@ func safeURL(address string) string { |
|
|
|
} |
|
|
|
|
|
|
|
type ContributorInfo struct { |
|
|
|
UserInfo *models.User // nil for contributor who is not a registered user |
|
|
|
RelAvatarLink string `json:"rel_avatar_link"` |
|
|
|
UserName string `json:"user_name"` |
|
|
|
Email string `json:"email"` |
|
|
|
CommitCnt int `json:"commit_cnt"` |
|
|
|
UserInfo *models.User // nil for contributor who is not a registered user |
|
|
|
RelAvatarLink string `json:"rel_avatar_link"` |
|
|
|
UserName string `json:"user_name"` |
|
|
|
Email string `json:"email"` |
|
|
|
CommitCnt int `json:"commit_cnt"` |
|
|
|
} |
|
|
|
|
|
|
|
type GetContributorsInfo struct { |
|
|
@@ -641,7 +647,7 @@ func Home(ctx *context.Context) { |
|
|
|
existedContributorInfo.CommitCnt += c.CommitCnt |
|
|
|
} else { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, "", "",c.Email, c.CommitCnt, |
|
|
|
user, "", "", c.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
@@ -838,7 +844,7 @@ func renderCode(ctx *context.Context) { |
|
|
|
compareInfo, err = baseGitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(), ctx.Repo.BranchName, ctx.Repo.Repository.BaseRepo.DefaultBranch) |
|
|
|
ctx.Data["UpstreamSameBranchName"] = false |
|
|
|
} |
|
|
|
if err==nil && compareInfo != nil { |
|
|
|
if err == nil && compareInfo != nil { |
|
|
|
if compareInfo.Commits != nil { |
|
|
|
log.Info("compareInfoCommits数量:%d", compareInfo.Commits.Len()) |
|
|
|
ctx.Data["FetchUpstreamCnt"] = compareInfo.Commits.Len() |
|
|
@@ -942,7 +948,7 @@ func ContributorsAPI(ctx *context.Context) { |
|
|
|
} else { |
|
|
|
// new committer info |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, user.RelAvatarLink(),user.Name, user.Email,c.CommitCnt, |
|
|
|
user, user.RelAvatarLink(), user.Name, user.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
@@ -955,7 +961,7 @@ func ContributorsAPI(ctx *context.Context) { |
|
|
|
existedContributorInfo.CommitCnt += c.CommitCnt |
|
|
|
} else { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, "", "",c.Email,c.CommitCnt, |
|
|
|
user, "", "", c.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
|