summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Azzopardi <sazzopardi@gitlab.com>2018-11-16 11:52:59 +0000
committerSteve Azzopardi <steveazz@outlook.com>2018-11-16 12:55:20 +0100
commit541e638ddbc1c04d14d8ed67035d581852e20522 (patch)
treed2fa6c2ad065d6123c88dbf63ae7cfc36e133c57 /lib
parent603800f26f4b0b39fe3de82ede75868f47eacc2d (diff)
downloadgitlab-ce-541e638ddbc1c04d14d8ed67035d581852e20522.tar.gz
Merge branch '54011-all-files-named-index-have-their-content-rendered-as-if-they-were-text-files' into 'master'
Resolve "All files named `index.*` have their content rendered as if they were text files" Closes #54011 See merge request gitlab-org/gitlab-ce!23063
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/file_detector.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb
index d6338b09e3d..2770469ca9f 100644
--- a/lib/gitlab/file_detector.rb
+++ b/lib/gitlab/file_detector.rb
@@ -8,7 +8,7 @@ module Gitlab
module FileDetector
PATTERNS = {
# Project files
- readme: %r{\A(readme|index)[^/]*\z}i,
+ readme: /\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?\z/i,
changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i,
license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i,
contributing: %r{\Acontributing[^/]*\z}i,