diff options
author | Jason Song <i@wolfogre.com> | 2023-01-09 11:50:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 11:50:54 +0800 |
commit | 7adc2de46404e32ed33f999d308ed56232cdfea5 (patch) | |
tree | 2404a22b5fa8a941eb5bfd16fd717fab29d899e4 /routers/web/repo/commit.go | |
parent | b878155b8741c2769b6aa50a80609c36822451c9 (diff) | |
download | gitea-7adc2de46404e32ed33f999d308ed56232cdfea5.tar.gz gitea-7adc2de46404e32ed33f999d308ed56232cdfea5.zip |
Use context parameter in models/git (#22367)
After #22362, we can feel free to use transactions without
`db.DefaultContext`.
And there are still lots of models using `db.DefaultContext`, I think we
should refactor them carefully and one by one.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/web/repo/commit.go')
-rw-r--r-- | routers/web/repo/commit.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go index 6eda3fca10..9f94159d0d 100644 --- a/routers/web/repo/commit.go +++ b/routers/web/repo/commit.go @@ -75,7 +75,7 @@ func Commits(ctx *context.Context) { ctx.ServerError("CommitsByRange", err) return } - ctx.Data["Commits"] = git_model.ConvertFromGitCommit(commits, ctx.Repo.Repository) + ctx.Data["Commits"] = git_model.ConvertFromGitCommit(ctx, commits, ctx.Repo.Repository) ctx.Data["Username"] = ctx.Repo.Owner.Name ctx.Data["Reponame"] = ctx.Repo.Repository.Name @@ -194,7 +194,7 @@ func SearchCommits(ctx *context.Context) { return } ctx.Data["CommitCount"] = len(commits) - ctx.Data["Commits"] = git_model.ConvertFromGitCommit(commits, ctx.Repo.Repository) + ctx.Data["Commits"] = git_model.ConvertFromGitCommit(ctx, commits, ctx.Repo.Repository) ctx.Data["Keyword"] = query if all { @@ -235,7 +235,7 @@ func FileHistory(ctx *context.Context) { ctx.ServerError("CommitsByFileAndRange", err) return } - ctx.Data["Commits"] = git_model.ConvertFromGitCommit(commits, ctx.Repo.Repository) + ctx.Data["Commits"] = git_model.ConvertFromGitCommit(ctx, commits, ctx.Repo.Repository) ctx.Data["Username"] = ctx.Repo.Owner.Name ctx.Data["Reponame"] = ctx.Repo.Repository.Name |