Commit 5439e5b7 authored by Patrick Steinhardt's avatar Patrick Steinhardt

spec: Do not recreate custom repositories

There are two project factories which create repositories, once with a
default repository and once with custom files which then get written
into the repository. These can be used in combination to use a default
repository which has a bunch of custom files on top, and some tests do
in fact do this. When doing so, we call Gitaly's `CreateRepository()`
RPC twice though, where the second call is idempotent and doesn't really
do anything interesting.

Gitaly is about to change behaviour of `CreateRepository()` to fail in
case it is asked to recreate an already existing repository. So let's
call `CreateRepository()` for custom repos only when they do not exist
yet.
parent 4c778e0d
......@@ -190,7 +190,7 @@ FactoryBot.define do
end
after :create do |project, evaluator|
raise "Failed to create repository!" unless project.create_repository
raise "Failed to create repository!" unless project.repository.exists? || project.create_repository
evaluator.files.each do |filename, content|
project.repository.create_file(
......
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