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
iv
gitlab-ce
Commits
72bd004b
Commit
72bd004b
authored
Feb 01, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow "@" in file names and path
parent
da8e0f86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+4
-4
spec/lib/gitlab/regex_spec.rb
spec/lib/gitlab/regex_spec.rb
+8
-0
No files found.
lib/gitlab/regex.rb
View file @
72bd004b
...
...
@@ -44,19 +44,19 @@ module Gitlab
def
file_name_regex
@file_name_regex
||=
/\A[a-zA-Z0-9_\-\.]*\z/
.
freeze
@file_name_regex
||=
/\A[a-zA-Z0-9_\-\.
\@
]*\z/
.
freeze
end
def
file_name_regex_message
"can contain only letters, digits, '_', '-' and '.'. "
"can contain only letters, digits, '_', '-'
, '@'
and '.'. "
end
def
file_path_regex
@file_path_regex
||=
/\A[a-zA-Z0-9_\-\.\/]*\z/
.
freeze
@file_path_regex
||=
/\A[a-zA-Z0-9_\-\.\/
\@
]*\z/
.
freeze
end
def
file_path_regex_message
"can contain only letters, digits, '_', '-' and '.'. Separate directories with a '/'. "
"can contain only letters, digits, '_', '-'
, '@'
and '.'. Separate directories with a '/'. "
end
...
...
spec/lib/gitlab/regex_spec.rb
View file @
72bd004b
...
...
@@ -21,4 +21,12 @@ describe Gitlab::Regex, lib: true do
it
{
expect
(
'Dash – is this'
).
to
match
(
Gitlab
::
Regex
.
project_name_regex
)
}
it
{
expect
(
'?gitlab'
).
not_to
match
(
Gitlab
::
Regex
.
project_name_regex
)
}
end
describe
'file name regex'
do
it
{
expect
(
'foo@bar'
).
to
match
(
Gitlab
::
Regex
.
file_name_regex
)
}
end
describe
'file path regex'
do
it
{
expect
(
'foo@/bar'
).
to
match
(
Gitlab
::
Regex
.
file_path_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