Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cb3f8510
Commit
cb3f8510
authored
Jan 18, 2018
by
Jakub Jirutka
Committed by
Achilleas Pipinellis
Nov 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render index.* like README.* when it's present in a directory
Resolves #18933
parent
c0d30fad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
changelogs/unreleased/18933-render-index-as-readme.yml
changelogs/unreleased/18933-render-index-as-readme.yml
+5
-0
lib/gitlab/file_detector.rb
lib/gitlab/file_detector.rb
+1
-1
spec/lib/gitlab/file_detector_spec.rb
spec/lib/gitlab/file_detector_spec.rb
+5
-1
No files found.
changelogs/unreleased/18933-render-index-as-readme.yml
0 → 100644
View file @
cb3f8510
---
title
:
Make index.* render like README.* when it's present in a repository
merge_request
:
16550
author
:
Jakub Jirutka
type
:
added
lib/gitlab/file_detector.rb
View file @
cb3f8510
...
@@ -8,7 +8,7 @@ module Gitlab
...
@@ -8,7 +8,7 @@ module Gitlab
module
FileDetector
module
FileDetector
PATTERNS
=
{
PATTERNS
=
{
# Project files
# Project files
readme:
%r{
\A
readme[^
/]*
\z
}i
,
readme:
%r{
\A
(readme|index)[^
\
/
]*
\z
}i
,
changelog:
%r{
\A
(changelog|history|changes|news)[^/]*
\z
}i
,
changelog:
%r{
\A
(changelog|history|changes|news)[^/]*
\z
}i
,
license:
%r{
\A
((un)?licen[sc]e|copying)(
\.
[^/]+)?
\z
}i
,
license:
%r{
\A
((un)?licen[sc]e|copying)(
\.
[^/]+)?
\z
}i
,
contributing:
%r{
\A
contributing[^/]*
\z
}i
,
contributing:
%r{
\A
contributing[^/]*
\z
}i
,
...
...
spec/lib/gitlab/file_detector_spec.rb
View file @
cb3f8510
...
@@ -15,7 +15,11 @@ describe Gitlab::FileDetector do
...
@@ -15,7 +15,11 @@ describe Gitlab::FileDetector do
describe
'.type_of'
do
describe
'.type_of'
do
it
'returns the type of a README file'
do
it
'returns the type of a README file'
do
expect
(
described_class
.
type_of
(
'README.md'
)).
to
eq
(
:readme
)
%w(README readme INDEX index)
.
each
do
|
filename
|
%w(.md .adoc)
.
each
do
|
extname
|
expect
(
described_class
.
type_of
(
filename
+
extname
)).
to
eq
(
:readme
)
end
end
end
end
it
'returns nil for a README file in a directory'
do
it
'returns nil for a README file in a directory'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment