summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-28 06:24:05 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-28 06:24:05 +0300
commite9394c48ca7aacd9d151519c1da51d18a21b351b (patch)
treed1c8388af5f542fcd51d6be178024b145f5c9bef /app/models/namespace.rb
parentd03964d6ec4351be76ec978fc0481f24c3b623ec (diff)
downloadgitlab-ce-e9394c48ca7aacd9d151519c1da51d18a21b351b.tar.gz
Fix dir_exists?
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index d9c45cb13e2..d34e5a99c79 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -51,12 +51,17 @@ class Namespace < ActiveRecord::Base
end
def ensure_dir_exist
- dir_exists? || system("mkdir -m 770 #{namespace_dir_path}")
+ unless dir_exists?
+ system("mkdir -m 770 #{namespace_full_path}")
+ end
end
def dir_exists?
- namespace_dir_path = File.join(Gitlab.config.gitolite.repos_path, path)
- File.exists?(namespace_dir_path)
+ File.exists?(namespace_full_path)
+ end
+
+ def namespace_full_path
+ @namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
end
def move_dir