diff options
author | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-08-10 17:08:48 +0300 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-08-30 21:51:56 +0300 |
commit | b77176d11a7a31acd38b05aa39afc9ebed5a3915 (patch) | |
tree | 427c1c50b3a3f20260db1fd2113ea6f56a34ebea /lib/gitlab/gitaly_client/repository_service.rb | |
parent | ef8eb3f6f7c1af167017ecc854e9fe385cee9354 (diff) |
Migrate Repository.FetchRemote to Gitaly
- `Gitlab::Shell.fetch_remote` now takes a `Gitlab::Git::Repository` instead
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 a74a6dc6e78..177a1284f38 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -37,6 +37,22 @@ module Gitlab request = Gitaly::ApplyGitattributesRequest.new(repository: @gitaly_repo, revision: revision) GitalyClient.call(@storage, :repository_service, :apply_gitattributes, request) end + + def fetch_remote(remote, ssh_auth: nil, forced: false, no_tags: false) + request = Gitaly::FetchRemoteRequest.new(repository: @gitaly_repo, remote: remote, force: forced, no_tags: no_tags) + + if ssh_auth&.ssh_import? + if ssh_auth.ssh_key_auth? && ssh_auth.ssh_private_key.present? + request.ssh_key = ssh_auth.ssh_private_key + end + + if ssh_auth.ssh_known_hosts.present? + request.known_hosts = ssh_auth.ssh_known_hosts + end + end + + GitalyClient.call(@storage, :repository_service, :fetch_remote, request) + end end end end |