diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-27 09:31:15 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-27 09:31:15 +0300 |
commit | f5551efdfd71c6aedb609093374a6c4dbed6a78b (patch) | |
tree | 226bcf5561a02cea3c1b95339f7063a389cb7bf4 /app/models/namespace.rb | |
parent | 70bf7f6e191c0e99ad03e1eec2ecbe2aae53fa09 (diff) | |
download | gitlab-ce-f5551efdfd71c6aedb609093374a6c4dbed6a78b.tar.gz |
Rewrite and improve git backend logic. Fix project movind. Raise exception to prevent unexpected issues
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 7 |
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 |