diff options
author | Stan Hu <stanhu@gmail.com> | 2019-04-30 18:05:14 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-30 18:05:14 +0000 |
commit | f4cc9438e3d59f09b9a6f170f89ddd914d1efa4f (patch) | |
tree | 7ef38b73aaea19d7424918ed46ebf02f2798b8d9 /lib | |
parent | a78877bfbf827a61cc1e39601bbe14692a288a6b (diff) | |
parent | 5ee7876534891df9c2f5ab6c5112cc47f98b1df5 (diff) | |
download | gitlab-ce-f4cc9438e3d59f09b9a6f170f89ddd914d1efa4f.tar.gz |
Merge branch 'jc-client-for-fetch-objects-into-pool' into 'master'
Add client methods for FetchIntoObjectPool RPC
See merge request gitlab-org/gitlab-ce!27767
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/object_pool.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/gitaly_client/object_pool_service.rb | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/git/object_pool.rb b/lib/gitlab/git/object_pool.rb index 8eb3c28ab70..d0577d7a4ff 100644 --- a/lib/gitlab/git/object_pool.rb +++ b/lib/gitlab/git/object_pool.rb @@ -40,6 +40,10 @@ module Gitlab @repository ||= Gitlab::Git::Repository.new(storage, relative_path, GL_REPOSITORY, gl_project_path) end + def fetch + object_pool_service.fetch(source_repository) + end + private def object_pool_service diff --git a/lib/gitlab/gitaly_client/object_pool_service.rb b/lib/gitlab/gitaly_client/object_pool_service.rb index ce1fb4d68ae..d7fac26bc13 100644 --- a/lib/gitlab/gitaly_client/object_pool_service.rb +++ b/lib/gitlab/gitaly_client/object_pool_service.rb @@ -33,6 +33,15 @@ module Gitlab GitalyClient.call(storage, :object_pool_service, :link_repository_to_object_pool, request, timeout: GitalyClient.fast_timeout) end + + def fetch(repository) + request = Gitaly::FetchIntoObjectPoolRequest.new( + object_pool: object_pool, + origin: repository.gitaly_repository + ) + + GitalyClient.call(storage, :object_pool_service, :fetch_into_object_pool, request) + end end end end |