Assign the origin repo and the fork in the same partition in CreateFork
The source_repository
in CreateFork
is not annotated as an additional repository. This means we're currently not creating the fork in the same partition as the forkee. We need to handle this case separately to ensure both repositories are in the same partition so the fork can eventually be connected to the pool.
When transactions are enabled, we're assigning the object pool, origin repo and any linked repository in the same partition in a general manner by extracting the additional repository and ensuring it is in the same partition as the target repository. This works as a general method of ensuring all of the pool network's members are in the same partition.
Annotating the source_repository
as an additional repository won't work as Praefect rewrites the additional repository. This would lead to the fetch failing as Gitaly currently cloning the repo through the API. To do so, the original relative path must be used.