diff options
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r-- | routers/repo/pull.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 3240461c84..cf8c4829b4 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -26,6 +26,16 @@ const ( COMPARE_PULL base.TplName = "repo/pulls/compare" PULL_COMMITS base.TplName = "repo/pulls/commits" PULL_FILES base.TplName = "repo/pulls/files" + + PULL_REQUEST_TEMPLATE_KEY = "PullRequestTemplate" +) + +var ( + PullRequestTemplateCandidates = []string{ + "PULL_REQUEST.md", + ".gogs/PULL_REQUEST.md", + ".github/PULL_REQUEST.md", + } ) func getForkRepository(ctx *middleware.Context) *models.Repository { @@ -540,6 +550,7 @@ func CompareAndPullRequest(ctx *middleware.Context) { ctx.Data["PageIsComparePull"] = true ctx.Data["IsDiffCompare"] = true ctx.Data["RequireHighlightJS"] = true + setTemplateIfExists(ctx, PULL_REQUEST_TEMPLATE_KEY, PullRequestTemplateCandidates) renderAttachmentSettings(ctx) headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch := ParseCompareInfo(ctx) |