summaryrefslogtreecommitdiff
path: root/lib/gitlab/file_detector.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-10-11 16:48:43 +0100
committerSean McGivern <sean@gitlab.com>2017-10-12 13:26:03 +0100
commitb7303b65b1a761c7ad7ed9eed993ad55fcecb953 (patch)
treee1d7048be0f5994d9750b5c8b86c384291a0c459 /lib/gitlab/file_detector.rb
parent218e1f0963768fced0ed9a33762253c273c72069 (diff)
downloadgitlab-ce-b7303b65b1a761c7ad7ed9eed993ad55fcecb953.tar.gz
Cache issuable template names
We were looking these up on each request to an issue page, because the form is pre-filled, as is the template dropdown. That was unnecessary: we could just treat these as 'special' repository files (like the rendered README) and cache them in Redis until they change on a push.
Diffstat (limited to 'lib/gitlab/file_detector.rb')
-rw-r--r--lib/gitlab/file_detector.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb
index 1fa1399c531..0e9ef4f897c 100644
--- a/lib/gitlab/file_detector.rb
+++ b/lib/gitlab/file_detector.rb
@@ -12,6 +12,8 @@ module Gitlab
contributing: /\Acontributing[^\/]*\z/i,
version: 'version',
avatar: /\Alogo\.(png|jpg|gif)\z/,
+ issue_template: /\A\.gitlab\/issue_templates\/[^\/]+\.md\z/,
+ merge_request_template: /\A\.gitlab\/merge_request_templates\/[^\/]+\.md\z/,
# Configuration files
gitignore: '.gitignore',