Commit bf64582f authored by Bob Van Landuyt's avatar Bob Van Landuyt

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.
parent 9fc17f6f
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment