Add calculate_checksum method to the Gitaly repository client

parent b81c6f14
......@@ -262,6 +262,12 @@ module Gitlab
response.license_short_name.presence
end
def calculate_checksum
request = Gitaly::CalculateChecksumRequest.new(repository: @gitaly_repo)
response = GitalyClient.call(@storage, :repository_service, :calculate_checksum, request)
response.checksum.presence
end
end
end
end
......@@ -134,4 +134,15 @@ describe Gitlab::GitalyClient::RepositoryService do
client.squash_in_progress?(squash_id)
end
end
describe '#calculate_checksum' do
it 'sends a calculate_checksum message' do
expect_any_instance_of(Gitaly::RepositoryService::Stub)
.to receive(:calculate_checksum)
.with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
.and_return(double(checksum: 0))
client.calculate_checksum
end
end
end
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