forked from forgejo/forgejo
Replace list.List
with slices (#16311)
* Replaced list with slice. * Fixed usage of pointer to temporary variable. * Replaced LIFO list with slice. * Lint * Removed type check. * Removed duplicated code. * Lint * Fixed merge. Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
23d438f565
commit
d9ef43a712
29 changed files with 183 additions and 302 deletions
|
@ -551,14 +551,12 @@ func PrepareCompareDiff(
|
|||
return false
|
||||
}
|
||||
|
||||
compareInfo.Commits = models.ValidateCommitsWithEmails(compareInfo.Commits)
|
||||
compareInfo.Commits = models.ParseCommitsWithSignature(compareInfo.Commits, headRepo)
|
||||
compareInfo.Commits = models.ParseCommitsWithStatus(compareInfo.Commits, headRepo)
|
||||
ctx.Data["Commits"] = compareInfo.Commits
|
||||
ctx.Data["CommitCount"] = compareInfo.Commits.Len()
|
||||
commits := models.ConvertFromGitCommit(compareInfo.Commits, headRepo)
|
||||
ctx.Data["Commits"] = commits
|
||||
ctx.Data["CommitCount"] = len(commits)
|
||||
|
||||
if compareInfo.Commits.Len() == 1 {
|
||||
c := compareInfo.Commits.Front().Value.(models.SignCommitWithStatuses)
|
||||
if len(commits) == 1 {
|
||||
c := commits[0]
|
||||
title = strings.TrimSpace(c.UserCommit.Summary())
|
||||
|
||||
body := strings.Split(strings.TrimSpace(c.UserCommit.Message()), "\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue