Add calculate_checksum method to the Gitaly repository client
This commit is contained in:
parent
b81c6f142c
commit
e892eeb546
2 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue