diff options
author | Robert Speicher <robert@gitlab.com> | 2018-01-03 20:35:32 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-01-03 20:35:32 +0300 |
commit | f7cb21930abaaa94118c1981149010abdd62de1a (patch) | |
tree | 509210a0201581266ceee28370ec13ff9f66b830 /lib/gitlab/gitaly_client/repository_service.rb | |
parent | 91cb64bf0fb3096f07174585f5a0e3db69181571 (diff) | |
parent | 4b5b43383aa0bb391d131cdbfa55932579420f5b (diff) |
Merge branch 'migrate-fork-repo-to-gitaly' into 'master'
Migrate repo forking to Gitaly
Closes gitaly#825
See merge request gitlab-org/gitlab-ce!16018
Diffstat (limited to 'lib/gitlab/gitaly_client/repository_service.rb')
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index 2115f388d5b..d43d80da960 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -81,6 +81,22 @@ module Gitlab response.base.presence end + def fork_repository(source_repository) + request = Gitaly::CreateForkRequest.new( + repository: @gitaly_repo, + source_repository: source_repository.gitaly_repository + ) + + GitalyClient.call( + @storage, + :repository_service, + :create_fork, + request, + remote_storage: source_repository.storage, + timeout: GitalyClient.default_timeout + ) + end + def fetch_source_branch(source_repository, source_branch, local_ref) request = Gitaly::FetchSourceBranchRequest.new( repository: @gitaly_repo, |