diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-03-31 08:46:51 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-04-02 12:03:28 +0200 |
commit | bf64582f671ae057c853ff97876348574fe14a53 (patch) | |
tree | 4ceb6e235906a8f98029b0251979391bd45a348d | |
parent | 9fc17f6f4abdb04f3cf1b60b87bd67b894a19c39 (diff) | |
download | gitlab-ce-bvl-cleanup-repos.tar.gz |
Fix warning when cloning repo that already existsbvl-cleanup-repos
fixes the warning:
fatal: destination path '~/gitlab-ce/gitlab/tmp/tests/gitlab-test-fork_bare' already exists and is not an empty directory.
-rw-r--r-- | spec/support/test_env.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb index a19a35c2c0d..1b5cb71a6b0 100644 --- a/spec/support/test_env.rb +++ b/spec/support/test_env.rb @@ -131,8 +131,10 @@ module TestEnv set_repo_refs(repo_path, branch_sha) - # We must copy bare repositories because we will push to them. - system(git_env, *%W(#{Gitlab.config.git.bin_path} clone -q --bare #{repo_path} #{repo_path_bare})) + unless File.directory?(repo_path_bare) + # We must copy bare repositories because we will push to them. + system(git_env, *%W(#{Gitlab.config.git.bin_path} clone -q --bare #{repo_path} #{repo_path_bare})) + end end def copy_repo(project) |