summaryrefslogtreecommitdiffstats
path: root/services/pull/pull.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-03 10:48:26 +0800
committerGitHub <noreply@github.com>2022-12-03 10:48:26 +0800
commit0a7d3ff786508284224ada17956a65bb759d9265 (patch)
tree4860fca95c1432ab59c6723ee2b053b1c7d6779d /services/pull/pull.go
parent8698458f48eafeab21014db544aa7160368856e1 (diff)
downloadgitea-0a7d3ff786508284224ada17956a65bb759d9265.tar.gz
gitea-0a7d3ff786508284224ada17956a65bb759d9265.zip
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'services/pull/pull.go')
-rw-r--r--services/pull/pull.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go
index ddb407b053..fd907491d4 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -230,7 +230,7 @@ func ChangeTargetBranch(ctx context.Context, pr *issues_model.PullRequest, doer
}
func checkForInvalidation(ctx context.Context, requests issues_model.PullRequestList, repoID int64, doer *user_model.User, branch string) error {
- repo, err := repo_model.GetRepositoryByIDCtx(ctx, repoID)
+ repo, err := repo_model.GetRepositoryByID(ctx, repoID)
if err != nil {
return fmt.Errorf("GetRepositoryByIDCtx: %w", err)
}
@@ -594,7 +594,7 @@ func GetSquashMergeCommitMessages(ctx context.Context, pr *issues_model.PullRequ
if pr.HeadRepo == nil {
var err error
- pr.HeadRepo, err = repo_model.GetRepositoryByIDCtx(ctx, pr.HeadRepoID)
+ pr.HeadRepo, err = repo_model.GetRepositoryByID(ctx, pr.HeadRepoID)
if err != nil {
log.Error("GetRepositoryByIdCtx[%d]: %v", pr.HeadRepoID, err)
return ""