aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/commit.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-08-09 20:08:51 +0200
committerGitHub <noreply@github.com>2021-08-09 14:08:51 -0400
commitd9ef43a7126ab83af563c1c9b54cdf0092327b2a (patch)
treefabc9a9d24d42bb0de6dd9557c9e07e95bd5722b /routers/web/repo/commit.go
parent23d438f56524a7c3fc185df66d6d95f797a80eee (diff)
downloadgitea-d9ef43a7126ab83af563c1c9b54cdf0092327b2a.tar.gz
gitea-d9ef43a7126ab83af563c1c9b54cdf0092327b2a.zip
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>
Diffstat (limited to 'routers/web/repo/commit.go')
-rw-r--r--routers/web/repo/commit.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go
index fcc17a40ab..e1d93a2435 100644
--- a/routers/web/repo/commit.go
+++ b/routers/web/repo/commit.go
@@ -72,10 +72,7 @@ func Commits(ctx *context.Context) {
ctx.ServerError("CommitsByRange", err)
return
}
- commits = models.ValidateCommitsWithEmails(commits)
- commits = models.ParseCommitsWithSignature(commits, ctx.Repo.Repository)
- commits = models.ParseCommitsWithStatus(commits, ctx.Repo.Repository)
- ctx.Data["Commits"] = commits
+ ctx.Data["Commits"] = models.ConvertFromGitCommit(commits, ctx.Repo.Repository)
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
@@ -193,10 +190,8 @@ func SearchCommits(ctx *context.Context) {
ctx.ServerError("SearchCommits", err)
return
}
- commits = models.ValidateCommitsWithEmails(commits)
- commits = models.ParseCommitsWithSignature(commits, ctx.Repo.Repository)
- commits = models.ParseCommitsWithStatus(commits, ctx.Repo.Repository)
- ctx.Data["Commits"] = commits
+ ctx.Data["CommitCount"] = len(commits)
+ ctx.Data["Commits"] = models.ConvertFromGitCommit(commits, ctx.Repo.Repository)
ctx.Data["Keyword"] = query
if all {
@@ -204,7 +199,6 @@ func SearchCommits(ctx *context.Context) {
}
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
- ctx.Data["CommitCount"] = commits.Len()
ctx.Data["Branch"] = ctx.Repo.BranchName
ctx.HTML(http.StatusOK, tplCommits)
}
@@ -239,10 +233,7 @@ func FileHistory(ctx *context.Context) {
ctx.ServerError("CommitsByFileAndRange", err)
return
}
- commits = models.ValidateCommitsWithEmails(commits)
- commits = models.ParseCommitsWithSignature(commits, ctx.Repo.Repository)
- commits = models.ParseCommitsWithStatus(commits, ctx.Repo.Repository)
- ctx.Data["Commits"] = commits
+ ctx.Data["Commits"] = models.ConvertFromGitCommit(commits, ctx.Repo.Repository)
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name