aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/pull.go')
-rw-r--r--routers/api/v1/repo/pull.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index 94262f81d1..6b076eff8f 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -111,11 +111,11 @@ func ListPullRequests(ctx *context.APIContext) {
ctx.Error(http.StatusInternalServerError, "LoadAttributes", err)
return
}
- if err = prs[i].LoadBaseRepo(); err != nil {
+ if err = prs[i].LoadBaseRepoCtx(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadBaseRepo", err)
return
}
- if err = prs[i].LoadHeadRepo(); err != nil {
+ if err = prs[i].LoadHeadRepoCtx(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadHeadRepo", err)
return
}
@@ -167,11 +167,11 @@ func GetPullRequest(ctx *context.APIContext) {
return
}
- if err = pr.LoadBaseRepo(); err != nil {
+ if err = pr.LoadBaseRepoCtx(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadBaseRepo", err)
return
}
- if err = pr.LoadHeadRepo(); err != nil {
+ if err = pr.LoadHeadRepoCtx(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadHeadRepo", err)
return
}
@@ -724,7 +724,7 @@ func MergePullRequest(ctx *context.APIContext) {
return
}
- if err := pr.LoadHeadRepo(); err != nil {
+ if err := pr.LoadHeadRepoCtx(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadHeadRepo", err)
return
}
@@ -943,7 +943,7 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption)
}
// user should have permission to read baseRepo's codes and pulls, NOT headRepo's
- permBase, err := models.GetUserRepoPermission(baseRepo, ctx.Doer)
+ permBase, err := models.GetUserRepoPermission(ctx, baseRepo, ctx.Doer)
if err != nil {
headGitRepo.Close()
ctx.Error(http.StatusInternalServerError, "GetUserRepoPermission", err)
@@ -962,7 +962,7 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption)
}
// user should have permission to read headrepo's codes
- permHead, err := models.GetUserRepoPermission(headRepo, ctx.Doer)
+ permHead, err := models.GetUserRepoPermission(ctx, headRepo, ctx.Doer)
if err != nil {
headGitRepo.Close()
ctx.Error(http.StatusInternalServerError, "GetUserRepoPermission", err)
@@ -1063,18 +1063,18 @@ func UpdatePullRequest(ctx *context.APIContext) {
return
}
- if err = pr.LoadBaseRepo(); err != nil {
+ if err = pr.LoadBaseRepoCtx(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadBaseRepo", err)
return
}
- if err = pr.LoadHeadRepo(); err != nil {
+ if err = pr.LoadHeadRepoCtx(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadHeadRepo", err)
return
}
rebase := ctx.FormString("style") == "rebase"
- allowedUpdateByMerge, allowedUpdateByRebase, err := pull_service.IsUserAllowedToUpdate(pr, ctx.Doer)
+ allowedUpdateByMerge, allowedUpdateByRebase, err := pull_service.IsUserAllowedToUpdate(ctx, pr, ctx.Doer)
if err != nil {
ctx.Error(http.StatusInternalServerError, "IsUserAllowedToMerge", err)
return
@@ -1151,7 +1151,7 @@ func GetPullRequestCommits(ctx *context.APIContext) {
return
}
- if err := pr.LoadBaseRepo(); err != nil {
+ if err := pr.LoadBaseRepoCtx(ctx); err != nil {
ctx.InternalServerError(err)
return
}