summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-05-30 08:04:12 -0400
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-05-30 07:04:12 -0500
commit642f844735f50fbc531dc01a0a89d004b9ecd042 (patch)
tree24bec33cf7d5ddb4a5f0112ec9ead82c2af1bd7b /modules
parent474d6367946c661ea4b8a6b8b25fab1b5bec15d2 (diff)
downloadgitea-642f844735f50fbc531dc01a0a89d004b9ecd042.tar.gz
gitea-642f844735f50fbc531dc01a0a89d004b9ecd042.zip
Fix PR template error (#1834)
Diffstat (limited to 'modules')
-rw-r--r--modules/context/repo.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index a59dc7da28..919105f7b7 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -332,13 +332,11 @@ func RepoAssignment() macaron.Handler {
if ctx.Repo.IsWriter() || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {
// Pull request is allowed if this is a fork repository
// and base repository accepts pull requests.
- if repo.BaseRepo != nil {
- if repo.BaseRepo.AllowsPulls() {
- ctx.Data["BaseRepo"] = repo.BaseRepo
- ctx.Repo.PullRequest.BaseRepo = repo.BaseRepo
- ctx.Repo.PullRequest.Allowed = true
- ctx.Repo.PullRequest.HeadInfo = ctx.Repo.Owner.Name + ":" + ctx.Repo.BranchName
- }
+ if repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls() {
+ ctx.Data["BaseRepo"] = repo.BaseRepo
+ ctx.Repo.PullRequest.BaseRepo = repo.BaseRepo
+ ctx.Repo.PullRequest.Allowed = true
+ ctx.Repo.PullRequest.HeadInfo = ctx.Repo.Owner.Name + ":" + ctx.Repo.BranchName
} else {
// Or, this is repository accepts pull requests between branches.
if repo.AllowsPulls() {