Commit e9394c48 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix dir_exists?

parent d03964d6
...@@ -51,12 +51,17 @@ class Namespace < ActiveRecord::Base ...@@ -51,12 +51,17 @@ class Namespace < ActiveRecord::Base
end end
def ensure_dir_exist 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 end
def dir_exists? def dir_exists?
namespace_dir_path = File.join(Gitlab.config.gitolite.repos_path, path) File.exists?(namespace_full_path)
File.exists?(namespace_dir_path) end
def namespace_full_path
@namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
end end
def move_dir def move_dir
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment