aboutsummaryrefslogtreecommitdiffstats
path: root/services/pull/merge.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-10 10:46:31 +0800
committerGitHub <noreply@github.com>2022-12-10 10:46:31 +0800
commit68704532c28cf09db96c988291b2f82c5e615984 (patch)
treec6537092dc11054f96b202fdb957755ed116cd99 /services/pull/merge.go
parent097d4e30b180eef30600beef2c08095e2571319c (diff)
downloadgitea-68704532c28cf09db96c988291b2f82c5e615984.tar.gz
gitea-68704532c28cf09db96c988291b2f82c5e615984.zip
Rename almost all Ctx functions (#22071)
Diffstat (limited to 'services/pull/merge.go')
-rw-r--r--services/pull/merge.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go
index 9270fb8cbc..1c42c1c17b 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -54,7 +54,7 @@ func GetDefaultMergeMessage(ctx context.Context, baseGitRepo *git.Repository, pr
return "", err
}
- isExternalTracker := pr.BaseRepo.UnitEnabled(unit.TypeExternalTracker)
+ isExternalTracker := pr.BaseRepo.UnitEnabled(ctx, unit.TypeExternalTracker)
issueReference := "#"
if isExternalTracker {
issueReference = "!"
@@ -145,11 +145,11 @@ func Merge(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.U
defer pullWorkingPool.CheckOut(fmt.Sprint(pr.ID))
// Removing an auto merge pull and ignore if not exist
- if err := pull_model.DeleteScheduledAutoMerge(db.DefaultContext, pr.ID); err != nil && !db.IsErrNotExist(err) {
+ if err := pull_model.DeleteScheduledAutoMerge(ctx, pr.ID); err != nil && !db.IsErrNotExist(err) {
return err
}
- prUnit, err := pr.BaseRepo.GetUnit(unit.TypePullRequests)
+ prUnit, err := pr.BaseRepo.GetUnit(ctx, unit.TypePullRequests)
if err != nil {
log.Error("pr.BaseRepo.GetUnit(unit.TypePullRequests): %v", err)
return err
@@ -828,7 +828,7 @@ func MergedManually(pr *issues_model.PullRequest, doer *user_model.User, baseGit
defer pullWorkingPool.CheckOut(fmt.Sprint(pr.ID))
if err := db.WithTx(db.DefaultContext, func(ctx context.Context) error {
- prUnit, err := pr.BaseRepo.GetUnitCtx(ctx, unit.TypePullRequests)
+ prUnit, err := pr.BaseRepo.GetUnit(ctx, unit.TypePullRequests)
if err != nil {
return err
}