diff --git a/app/models/repository.rb b/app/models/repository.rb index d9b0d1fbe222153ea470a54e4bba78210919684f..e970c449a7342b01b69d1ce8236514c8f0ed063f 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -10,8 +10,11 @@ class Repository nil end + # Return absolute path to repository def path_to_repo - @path_to_repo ||= File.join(Gitlab.config.gitlab_shell.repos_path, path_with_namespace + ".git") + @path_to_repo ||= File.expand_path( + File.join(Gitlab.config.gitlab_shell.repos_path, path_with_namespace + ".git") + ) end def exists?