summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)