summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorLin Jen-Shin (godfat) <godfat@godfat.org>2017-05-26 19:18:07 +0000
committerLin Jen-Shin (godfat) <godfat@godfat.org>2017-05-26 19:18:07 +0000
commitb5e8de5c4c202d10ef8b48248b12f49c1330d04a (patch)
treee034bee79723e84eab1e9257c3848d4c991d5333 /app/models/project.rb
parent8f44bc4dc10caf3c9856a8e4bea5ac145a315131 (diff)
parent3605e4307ddf373071c0353a066c50fcead01e45 (diff)
downloadgitlab-ce-b5e8de5c4c202d10ef8b48248b12f49c1330d04a.tar.gz
Merge branch 'master' into '24196-protected-variables'
# Conflicts: # db/schema.rb
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index fbf2a0a75ca..a0314bf9e49 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