Skip to content

Commit e9394c4

Browse files
committed
Fix dir_exists?
1 parent d03964d commit e9394c4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/models/namespace.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ def human_name
5151
end
5252

5353
def ensure_dir_exist
54-
dir_exists? || system("mkdir -m 770 #{namespace_dir_path}")
54+
unless dir_exists?
55+
system("mkdir -m 770 #{namespace_full_path}")
56+
end
5557
end
5658

5759
def dir_exists?
58-
namespace_dir_path = File.join(Gitlab.config.gitolite.repos_path, path)
59-
File.exists?(namespace_dir_path)
60+
File.exists?(namespace_full_path)
61+
end
62+
63+
def namespace_full_path
64+
@namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
6065
end
6166

6267
def move_dir

0 commit comments

Comments
 (0)