summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/compare.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/compare.go')
-rw-r--r--routers/web/repo/compare.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go
index f34d3a5203..e35af31724 100644
--- a/routers/web/repo/compare.go
+++ b/routers/web/repo/compare.go
@@ -784,7 +784,11 @@ func CompareDiff(ctx *context.Context) {
ctx.Data["IsRepoToolbarCommits"] = true
ctx.Data["IsDiffCompare"] = true
ctx.Data["RequireTribute"] = true
- setTemplateIfExists(ctx, pullRequestTemplateKey, nil, pullRequestTemplateCandidates)
+ templateErrs := setTemplateIfExists(ctx, pullRequestTemplateKey, pullRequestTemplateCandidates)
+
+ if len(templateErrs) > 0 {
+ ctx.Flash.Warning(renderErrorOfTemplates(ctx, templateErrs), true)
+ }
// If a template content is set, prepend the "content". In this case that's only
// applicable if you have one commit to compare and that commit has a message.