gitlab-org--gitlab-foss/spec/support/helpers/git_helpers.rb
Alejandro Rodríguez a99bf447a2 Remove Gitlab::Git::Repository#rugged and Gollum code
Cleanup code, and refactor tests that still use Rugged. After this, there should
be no Rugged code that access the instance's repositories on non-test
environments. There is still some rugged code for other tasks like the
repository import task, but since it doesn't access any repository storage path
it can stay.
2018-10-02 16:34:28 -03:00

17 lines
438 B
Ruby

# frozen_string_literal: true
module GitHelpers
def rugged_repo(repository)
path = File.join(TestEnv.repos_path, repository.disk_path + '.git')
Rugged::Repository.new(path)
end
def project_hook_exists?(project)
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
project_path = project.repository.raw_repository.path
File.exist?(File.join(project_path, 'hooks', 'post-receive'))
end
end
end