diff options
author | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-06-07 17:25:54 +0200 |
---|---|---|
committer | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-06-07 17:25:54 +0200 |
commit | 8bafce90895001839a3452e7fc6c647ddcbb2452 (patch) | |
tree | 234f6cddb423eef6b69d1961fe2702cfd6ccff53 | |
parent | 694586fcbeb9fc22da2887577e4446c03fa659cf (diff) | |
download | gitlab-ce-test.tar.gz |
testtest
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index 8f8e8dbeae8..5a0129a3cce 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -213,12 +213,32 @@ module Gitlab end def create_from_bundle(bundle_path) - gitaly_repo_stream_request( - bundle_path, + request = Gitaly::CreateRepositoryFromBundleRequest.new(repository: @gitaly_repo) + enum = Enumerator.new do |y| + File.open(bundle_path, 'rb') do |f| + while data = f.read(MAX_MSG_SIZE) + request.data = data + + y.yield request + request = Gitaly::CreateRepositoryFromBundleRequest.new + end + end + end + + GitalyClient.call( + @storage, + :repository_service, :create_repository_from_bundle, - Gitaly::CreateRepositoryFromBundleRequest, - Gitaly.default_timeout + enum, + timeout: Gitaly.default_timeout ) + + # gitaly_repo_stream_request( + # bundle_path, + # :create_repository_from_bundle, + # Gitaly::CreateRepositoryFromBundleRequest, + # Gitaly.default_timeout + # ) end def restore_custom_hooks(custom_hooks_path) |