diff options
author | JakobDev <jakobdev@gmx.de> | 2023-10-11 06:24:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 04:24:07 +0000 |
commit | ebe803e514acb4eedc884226be2489ee6b4acd28 (patch) | |
tree | 3f4d38f8267142dcd0e8df7d76cd4fe04c47b85e /modules/context | |
parent | 50166d1f7c6df41c79561b094e29c9698c0000d5 (diff) | |
download | gitea-ebe803e514acb4eedc884226be2489ee6b4acd28.tar.gz gitea-ebe803e514acb4eedc884226be2489ee6b4acd28.zip |
Penultimate round of `db.DefaultContext` refactor (#27414)
Part of #27065
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/context')
-rw-r--r-- | modules/context/repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 18b6650b6e..b340a6e230 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -495,7 +495,7 @@ func RepoAssignment(ctx *Context) context.CancelFunc { } // Get repository. - repo, err := repo_model.GetRepositoryByName(owner.ID, repoName) + repo, err := repo_model.GetRepositoryByName(ctx, owner.ID, repoName) if err != nil { if repo_model.IsErrRepoNotExist(err) { redirectRepoID, err := repo_model.LookupRedirect(owner.ID, repoName) @@ -711,13 +711,13 @@ func RepoAssignment(ctx *Context) context.CancelFunc { // Pull request is allowed if this is a fork repository // and base repository accepts pull requests. - if repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls() { + if repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls(ctx) { canCompare = true ctx.Data["BaseRepo"] = repo.BaseRepo ctx.Repo.PullRequest.BaseRepo = repo.BaseRepo ctx.Repo.PullRequest.Allowed = canPush ctx.Repo.PullRequest.HeadInfoSubURL = url.PathEscape(ctx.Repo.Owner.Name) + ":" + util.PathEscapeSegments(ctx.Repo.BranchName) - } else if repo.AllowsPulls() { + } else if repo.AllowsPulls(ctx) { // Or, this is repository accepts pull requests between branches. canCompare = true ctx.Data["BaseRepo"] = repo |