diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-18 20:33:35 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-24 14:10:31 +0300 |
commit | 24625323a826d70991fdf27fbbe1f39bee845c03 (patch) | |
tree | 8c7b3e7c949638ae1be4d655345f798e2d9bea9e /lib/gitlab/gitaly_client/repository_service.rb | |
parent | e2a56af930f9f7d17a6a9b638f52007a60e4cc60 (diff) |
Migrate repository bundling to Gitaly
Closes gitaly#929
Diffstat (limited to 'lib/gitlab/gitaly_client/repository_service.rb')
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index 12016aee2a6..654a3c314f1 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -161,6 +161,23 @@ module Gitlab return response.error.b, 1 end end + + def create_bundle(save_path) + request = Gitaly::CreateBundleRequest.new(repository: @gitaly_repo) + response = GitalyClient.call( + @storage, + :repository_service, + :create_bundle, + request, + timeout: GitalyClient.default_timeout + ) + + File.open(save_path, 'wb') do |f| + response.each do |message| + f.write(message.data) + end + end + end end end end |