Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-03-31 09:46:51 +0300
committerBob Van Landuyt <bob@gitlab.com>2017-04-02 13:03:28 +0300
commitbf64582f671ae057c853ff97876348574fe14a53 (patch)
tree4ceb6e235906a8f98029b0251979391bd45a348d /spec
parent9fc17f6f4abdb04f3cf1b60b87bd67b894a19c39 (diff)
Fix warning when cloning repo that already exists
fixes the warning: fatal: destination path '~/gitlab-ce/gitlab/tmp/tests/gitlab-test-fork_bare' already exists and is not an empty directory.
Diffstat (limited to 'spec')
-rw-r--r--spec/support/test_env.rb6
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)