diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-01-25 14:28:48 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-01-25 14:28:48 +0000 |
commit | 9df130ff2291849bc345494f78cb239fb300d59d (patch) | |
tree | 433e28487bbb7ad5bb2d3ef64ed825ae94110252 /lib | |
parent | 72e5a49999ec8c0c4ed16ddaacb8793f91a92ac7 (diff) | |
parent | 07b0beb00413585a8d2980b201d6ed8f34543f0c (diff) | |
download | gitlab-ce-9df130ff2291849bc345494f78cb239fb300d59d.tar.gz |
Merge branch 'fix/batch-lfs-pointers-accepting-lazy-enum' into 'master'
Fix .batch_lfs_pointers accepting a lazy enumerator
See merge request gitlab-org/gitlab-ce!16701
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 |