From ad640bc5f92ef0456a53dd82004f449cd9d7475d Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 23 Feb 2017 17:55:01 -0600 Subject: Use Namespace#full_path instead of #path where appropriate --- app/models/project.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/models/project.rb') 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{ ((?#{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}" -- cgit v1.2.1