summaryrefslogtreecommitdiffstats
path: root/services/pull/temp_repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/pull/temp_repo.go')
-rw-r--r--services/pull/temp_repo.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/services/pull/temp_repo.go b/services/pull/temp_repo.go
index e30dba7add..d5dc8a5c4b 100644
--- a/services/pull/temp_repo.go
+++ b/services/pull/temp_repo.go
@@ -12,6 +12,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/modules/git"
"code.gitea.io/gitea/modules/log"
)
@@ -24,7 +26,7 @@ func createTemporaryRepo(pr *models.PullRequest) (string, error) {
return "", fmt.Errorf("LoadHeadRepo: %v", err)
} else if pr.HeadRepo == nil {
log.Error("Pr %d HeadRepo %d does not exist", pr.ID, pr.HeadRepoID)
- return "", &models.ErrRepoNotExist{
+ return "", &repo_model.ErrRepoNotExist{
ID: pr.HeadRepoID,
}
} else if err := pr.LoadBaseRepo(); err != nil {
@@ -32,13 +34,13 @@ func createTemporaryRepo(pr *models.PullRequest) (string, error) {
return "", fmt.Errorf("LoadBaseRepo: %v", err)
} else if pr.BaseRepo == nil {
log.Error("Pr %d BaseRepo %d does not exist", pr.ID, pr.BaseRepoID)
- return "", &models.ErrRepoNotExist{
+ return "", &repo_model.ErrRepoNotExist{
ID: pr.BaseRepoID,
}
- } else if err := pr.HeadRepo.GetOwner(); err != nil {
+ } else if err := pr.HeadRepo.GetOwner(db.DefaultContext); err != nil {
log.Error("HeadRepo.GetOwner: %v", err)
return "", fmt.Errorf("HeadRepo.GetOwner: %v", err)
- } else if err := pr.BaseRepo.GetOwner(); err != nil {
+ } else if err := pr.BaseRepo.GetOwner(db.DefaultContext); err != nil {
log.Error("BaseRepo.GetOwner: %v", err)
return "", fmt.Errorf("BaseRepo.GetOwner: %v", err)
}