summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/namespace.rb6
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