Commit a2581af6 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'refactor-around-get-all_lfs_pointer' into 'master'

Fix code around GetAllLFSPointersRequest

See merge request gitlab-org/gitlab!27830
parents 6be2c3a9 b20e55f5
......@@ -15,7 +15,7 @@ describe Gitlab::Cleanup::OrphanLfsFileReferences do
allow(Gitlab.config.lfs).to receive(:enabled).and_return(true)
# Create a valid reference
oid = project.repository.gitaly_blob_client.get_all_lfs_pointers(nil).first.lfs_oid
oid = project.repository.gitaly_blob_client.get_all_lfs_pointers.first.lfs_oid
lfs_object2 = create(:lfs_object, oid: oid)
create(:lfs_objects_project, project: project, lfs_object: lfs_object2)
end
......
......@@ -40,7 +40,7 @@ module Gitlab
end
def lfs_oids_from_repository
project.repository.gitaly_blob_client.get_all_lfs_pointers(nil).map(&:lfs_oid)
project.repository.gitaly_blob_client.get_all_lfs_pointers.map(&:lfs_oid)
end
def orphan_oids
......
......@@ -13,7 +13,7 @@ module Gitlab
end
def all_pointers
@repository.gitaly_blob_client.get_all_lfs_pointers(@newrev)
@repository.gitaly_blob_client.get_all_lfs_pointers
end
end
end
......
......@@ -131,10 +131,9 @@ module Gitlab
map_lfs_pointers(response)
end
def get_all_lfs_pointers(revision)
request = Gitaly::GetNewLFSPointersRequest.new(
repository: @gitaly_repo,
revision: encode_binary(revision)
def get_all_lfs_pointers
request = Gitaly::GetAllLFSPointersRequest.new(
repository: @gitaly_repo
)
response = GitalyClient.call(@gitaly_repo.storage_name, :blob_service, :get_all_lfs_pointers, request, timeout: GitalyClient.medium_timeout)
......
......@@ -46,14 +46,12 @@ describe Gitlab::GitalyClient::BlobService do
end
describe '#get_all_lfs_pointers' do
let(:revision) { 'master' }
subject { client.get_all_lfs_pointers(revision) }
subject { client.get_all_lfs_pointers }
it 'sends a get_all_lfs_pointers message' do
expect_any_instance_of(Gitaly::BlobService::Stub)
.to receive(:get_all_lfs_pointers)
.with(gitaly_request_with_params(revision: revision), kind_of(Hash))
.with(gitaly_request_with_params({}), kind_of(Hash))
.and_return([])
subject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment