diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-25 12:46:15 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-25 16:11:27 +0300 |
commit | 07b0beb00413585a8d2980b201d6ed8f34543f0c (patch) | |
tree | 471eef02cb286b02dd645e98994ec738678d5cb1 /lib | |
parent | 944c1eb684fe979339262ba6e9f7bf9e1b77fc81 (diff) |
Fix .batch_lfs_pointers accepting a lazy enumerator
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/blob.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/gitaly_client/blob_service.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb index 81e46028752..13120120223 100644 --- a/lib/gitlab/git/blob.rb +++ b/lib/gitlab/git/blob.rb @@ -70,11 +70,9 @@ module Gitlab # Returns array of Gitlab::Git::Blob # Does not guarantee blob data will be set def batch_lfs_pointers(repository, blob_ids) - return [] if blob_ids.empty? - repository.gitaly_migrate(:batch_lfs_pointers) do |is_enabled| if is_enabled - repository.gitaly_blob_client.batch_lfs_pointers(blob_ids) + repository.gitaly_blob_client.batch_lfs_pointers(blob_ids.to_a) else blob_ids.lazy .select { |sha| possible_lfs_blob?(repository, sha) } diff --git a/lib/gitlab/gitaly_client/blob_service.rb b/lib/gitlab/gitaly_client/blob_service.rb index ee36684197b..d70a1a7665e 100644 --- a/lib/gitlab/gitaly_client/blob_service.rb +++ b/lib/gitlab/gitaly_client/blob_service.rb @@ -34,6 +34,8 @@ module Gitlab end def batch_lfs_pointers(blob_ids) + return [] if blob_ids.empty? + request = Gitaly::GetLFSPointersRequest.new( repository: @gitaly_repo, blob_ids: blob_ids |