diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-28 06:14:05 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-28 06:14:05 +0300 |
commit | d03964d6ec4351be76ec978fc0481f24c3b623ec (patch) | |
tree | 317b2ff65ba803ac598015fd2cfb50a5916b20c4 /app/models/namespace.rb | |
parent | d991ce636b9cda08b50fa216751de0234d36f774 (diff) | |
download | gitlab-ce-d03964d6ec4351be76ec978fc0481f24c3b623ec.tar.gz |
Fixed and improved enable_naamespace migration task
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 96f8f291451..d9c45cb13e2 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -51,8 +51,12 @@ class Namespace < ActiveRecord::Base end def ensure_dir_exist + dir_exists? || system("mkdir -m 770 #{namespace_dir_path}") + end + + def dir_exists? namespace_dir_path = File.join(Gitlab.config.gitolite.repos_path, path) - system("mkdir -m 770 #{namespace_dir_path}") unless File.exists?(namespace_dir_path) + File.exists?(namespace_dir_path) end def move_dir |