diff options
Diffstat (limited to 'services/pull/check.go')
-rw-r--r-- | services/pull/check.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/services/pull/check.go b/services/pull/check.go index 03d4a39919..363a716b28 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -13,6 +13,8 @@ import ( "strings" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/db" + repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unit" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/git" @@ -70,7 +72,7 @@ func checkAndUpdateStatus(pr *models.PullRequest) { func getMergeCommit(pr *models.PullRequest) (*git.Commit, error) { if pr.BaseRepo == nil { var err error - pr.BaseRepo, err = models.GetRepositoryByID(pr.BaseRepoID) + pr.BaseRepo, err = repo_model.GetRepositoryByID(pr.BaseRepoID) if err != nil { return nil, fmt.Errorf("GetRepositoryByID: %v", err) } @@ -165,7 +167,7 @@ func manuallyMerged(pr *models.PullRequest) bool { // When the commit author is unknown set the BaseRepo owner as merger if merger == nil { if pr.BaseRepo.Owner == nil { - if err = pr.BaseRepo.GetOwner(); err != nil { + if err = pr.BaseRepo.GetOwner(db.DefaultContext); err != nil { log.Error("BaseRepo.GetOwner[%d]: %v", pr.ID, err) return false } @@ -240,7 +242,7 @@ func handle(data ...queue.Data) { } // CheckPrsForBaseBranch check all pulls with bseBrannch -func CheckPrsForBaseBranch(baseRepo *models.Repository, baseBranchName string) error { +func CheckPrsForBaseBranch(baseRepo *repo_model.Repository, baseBranchName string) error { prs, err := models.GetUnmergedPullRequestsByBaseInfo(baseRepo.ID, baseBranchName) if err != nil { return err |