summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-23 17:55:01 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 17:55:01 -0600
commitad640bc5f92ef0456a53dd82004f449cd9d7475d (patch)
tree0da24fad5572f7fe272c15d842f9b1dfe89e7487 /app/models/project.rb
parent509ff2ab170802e23646282f1d146a6383b53a66 (diff)
downloadgitlab-ce-ad640bc5f92ef0456a53dd82004f449cd9d7475d.tar.gz
Use Namespace#full_path instead of #path where appropriatedm-more-namespace-full-path
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 301ff71cc01..765784de9e6 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -360,7 +360,7 @@ class Project < ActiveRecord::Base
end
def reference_pattern
- name_pattern = Gitlab::Regex::NAMESPACE_REGEX_STR
+ name_pattern = Gitlab::Regex::FULL_NAMESPACE_REGEX_STR
%r{
((?<namespace>#{name_pattern})\/)?
@@ -848,10 +848,6 @@ class Project < ActiveRecord::Base
gitlab_shell.url_to_repo(path_with_namespace)
end
- def namespace_dir
- namespace.try(:path) || ''
- end
-
def repo_exists?
@repo_exists ||= repository.exists?
rescue
@@ -900,8 +896,8 @@ class Project < ActiveRecord::Base
def rename_repo
path_was = previous_changes['path'].first
- old_path_with_namespace = File.join(namespace_dir, path_was)
- new_path_with_namespace = File.join(namespace_dir, path)
+ old_path_with_namespace = File.join(namespace.full_path, path_was)
+ new_path_with_namespace = File.join(namespace.full_path, path)
Rails.logger.error "Attempting to rename #{old_path_with_namespace} -> #{new_path_with_namespace}"