summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 8eae36db8e2..4e6125e354a 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -35,6 +35,10 @@ class Namespace < ActiveRecord::Base
where("name LIKE :query OR path LIKE :query", query: "%#{query}%")
end
+ def self.global_id
+ 'GLN'
+ end
+
def to_param
path
end
@@ -51,6 +55,9 @@ class Namespace < ActiveRecord::Base
def move_dir
old_path = File.join(Gitlab.config.git_base_path, path_was)
new_path = File.join(Gitlab.config.git_base_path, path)
+ if File.exists?(new_path)
+ raise "Already exists"
+ end
system("mv #{old_path} #{new_path}")
end