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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
4c3785af
Commit
4c3785af
authored
Jul 08, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-path-regex' into 'master'
Fix path regex Fixes #1208 See merge request !955
parents
ac1ff491
6a0cb250
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+1
-1
spec/lib/gitlab/regex_spec.rb
spec/lib/gitlab/regex_spec.rb
+21
-0
No files found.
lib/gitlab/regex.rb
View file @
4c3785af
...
...
@@ -72,7 +72,7 @@ module Gitlab
end
def
default_regex
/\A[
.?]?[a-zA-Z0-9_
][a-zA-Z0-9_\-\.]*(?<!\.git)\z/
/\A[
a-zA-Z0-9_.
][a-zA-Z0-9_\-\.]*(?<!\.git)\z/
end
end
end
spec/lib/gitlab/regex_spec.rb
0 → 100644
View file @
4c3785af
require
'spec_helper'
describe
Gitlab
::
Regex
do
describe
'path regex'
do
it
{
'gitlab-ce'
.
should
match
(
Gitlab
::
Regex
.
path_regex
)
}
it
{
'gitlab_git'
.
should
match
(
Gitlab
::
Regex
.
path_regex
)
}
it
{
'_underscore.js'
.
should
match
(
Gitlab
::
Regex
.
path_regex
)
}
it
{
'100px.com'
.
should
match
(
Gitlab
::
Regex
.
path_regex
)
}
it
{
'?gitlab'
.
should_not
match
(
Gitlab
::
Regex
.
path_regex
)
}
it
{
'git lab'
.
should_not
match
(
Gitlab
::
Regex
.
path_regex
)
}
it
{
'gitlab.git'
.
should_not
match
(
Gitlab
::
Regex
.
path_regex
)
}
end
describe
'project name regex'
do
it
{
'gitlab-ce'
.
should
match
(
Gitlab
::
Regex
.
project_name_regex
)
}
it
{
'GitLab CE'
.
should
match
(
Gitlab
::
Regex
.
project_name_regex
)
}
it
{
'100 lines'
.
should
match
(
Gitlab
::
Regex
.
project_name_regex
)
}
it
{
'gitlab.git'
.
should
match
(
Gitlab
::
Regex
.
project_name_regex
)
}
it
{
'?gitlab'
.
should_not
match
(
Gitlab
::
Regex
.
project_name_regex
)
}
end
end
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