2017-02-15 21:08:30 -05:00
|
|
|
module Gitlab
|
|
|
|
module GitalyClient
|
|
|
|
module Util
|
2017-04-06 10:54:15 -04:00
|
|
|
class << self
|
2017-09-20 18:33:56 -04:00
|
|
|
def repository(repository_storage, relative_path, gl_repository)
|
2018-03-30 05:19:46 -04:00
|
|
|
git_env = Gitlab::Git::HookEnv.all(gl_repository)
|
|
|
|
git_object_directory = git_env['GIT_OBJECT_DIRECTORY_RELATIVE'].presence
|
|
|
|
git_alternate_object_directories = Array.wrap(git_env['GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE'])
|
2017-10-05 10:51:31 -04:00
|
|
|
|
2017-04-06 10:54:15 -04:00
|
|
|
Gitaly::Repository.new(
|
|
|
|
storage_name: repository_storage,
|
2017-08-09 02:36:24 -04:00
|
|
|
relative_path: relative_path,
|
2017-12-19 11:45:58 -05:00
|
|
|
gl_repository: gl_repository.to_s,
|
2017-10-05 10:51:31 -04:00
|
|
|
git_object_directory: git_object_directory.to_s,
|
|
|
|
git_alternate_object_directories: git_alternate_object_directories
|
2017-04-06 10:54:15 -04:00
|
|
|
)
|
|
|
|
end
|
2017-09-20 06:11:51 -04:00
|
|
|
|
2017-12-05 14:42:04 -05:00
|
|
|
def git_repository(gitaly_repository)
|
|
|
|
Gitlab::Git::Repository.new(gitaly_repository.storage_name,
|
|
|
|
gitaly_repository.relative_path,
|
|
|
|
gitaly_repository.gl_repository)
|
|
|
|
end
|
2017-02-15 21:08:30 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|