diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 09:06:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-23 09:06:03 +0000 |
commit | b3e4ec8e8adf4fe96c982124e91b6a05021a9cda (patch) | |
tree | 5fda0011a7cc7de000186e465e61f893d478a1c8 /spec/support/helpers/test_env.rb | |
parent | 90cdc9391171e1be29b2b57a2e2aad0c02c2a7a9 (diff) | |
download | gitlab-ce-b3e4ec8e8adf4fe96c982124e91b6a05021a9cda.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers/test_env.rb')
-rw-r--r-- | spec/support/helpers/test_env.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index a409dd2ef26..538380a625c 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -243,6 +243,22 @@ module TestEnv FileUtils.chmod_R 0755, target_repo_path end + def rm_storage_dir(storage, dir) + Gitlab::GitalyClient::StorageSettings.allow_disk_access do + repos_path = Gitlab.config.repositories.storages[storage].legacy_disk_path + target_repo_refs_path = File.join(repos_path, dir) + FileUtils.remove_dir(target_repo_refs_path) + end + rescue Errno::ENOENT + end + + def storage_dir_exists?(storage, dir) + Gitlab::GitalyClient::StorageSettings.allow_disk_access do + repos_path = Gitlab.config.repositories.storages[storage].legacy_disk_path + File.exist?(File.join(repos_path, dir)) + end + end + def create_bare_repository(path) FileUtils.mkdir_p(path) |