diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-29 07:29:11 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-29 12:39:03 +0200 |
commit | eb1004f7890d25a86beb0ca0a7eca802d9fce665 (patch) | |
tree | 94cb713c0628542e646aad323be4d88fb1c356e3 /app/models/namespace.rb | |
parent | a1ffc673b95f4d0e2316d461f1364fa1ee08e9d2 (diff) | |
download | gitlab-ce-eb1004f7890d25a86beb0ca0a7eca802d9fce665.tar.gz |
Refactor abilities. Added ProjectUpdate context. Fixed few bugs with namespaces
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 5762bfc57cb..e1c24de949a 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -53,12 +53,14 @@ class Namespace < ActiveRecord::Base end 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" + if path_changed? + 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 - system("mv #{old_path} #{new_path}") end def rm_dir |