diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-24 20:59:26 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-24 20:59:26 +0000 |
commit | 43b1750892369d579edc7cd4e4ea1f7ac8667e34 (patch) | |
tree | 694921527f2697a38d478abcb585e0297951232b /app/models | |
parent | c846a8329ab24b551c1e6cc899434c0802769137 (diff) | |
download | gitlab-ce-43b1750892369d579edc7cd4e4ea1f7ac8667e34.tar.gz |
Revert "Remove changes that are not absolutely necessary"
This reverts commit b0498c176fa134761d899c9b369be12f1ca789c5
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 10 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index cfca0dcd2f2..29af57d7664 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -205,8 +205,8 @@ class Project < ActiveRecord::Base presence: true, dynamic_path: true, length: { maximum: 255 }, - format: { with: Gitlab::Regex.project_path_format_regex, - message: Gitlab::Regex.project_path_regex_message }, + format: { with: Gitlab::PathRegex.project_path_format_regex, + message: Gitlab::PathRegex.project_path_format_message }, uniqueness: { scope: :namespace_id } validates :namespace, presence: true @@ -380,11 +380,9 @@ class Project < ActiveRecord::Base end def reference_pattern - name_pattern = Gitlab::Regex::FULL_NAMESPACE_REGEX_STR - %r{ - ((?<namespace>#{name_pattern})\/)? - (?<project>#{name_pattern}) + ((?<namespace>#{Gitlab::PathRegex::FULL_NAMESPACE_FORMAT_REGEX})\/)? + (?<project>#{Gitlab::PathRegex::PROJECT_PATH_FORMAT_REGEX}) }x end diff --git a/app/models/user.rb b/app/models/user.rb index 837ab78228b..55614233230 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -367,7 +367,7 @@ class User < ActiveRecord::Base def reference_pattern %r{ #{Regexp.escape(reference_prefix)} - (?<user>#{Gitlab::Regex::FULL_NAMESPACE_REGEX_STR}) + (?<user>#{Gitlab::PathRegex::FULL_NAMESPACE_FORMAT_REGEX}) }x end |