Commit 3248d21a authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Remove an unused RPC

This RPC has been replaced by the RawPatch RPC, which is called by
workhorse as creating a patch could take a long time. The CommitPatch
RPC has no callsites in this codebase, which allows us to remove it.

Part of: https://gitlab.com/gitlab-org/gitaly/issues/2095
parent 2cd6006a
......@@ -298,18 +298,6 @@ module Gitlab
Gitlab::SafeRequestStore[key] = commit
end
# rubocop: disable CodeReuse/ActiveRecord
def patch(revision)
request = Gitaly::CommitPatchRequest.new(
repository: @gitaly_repo,
revision: encode_binary(revision)
)
response = GitalyClient.call(@repository.storage, :diff_service, :commit_patch, request, timeout: GitalyClient.medium_timeout)
response.sum(&:data)
end
# rubocop: enable CodeReuse/ActiveRecord
def commit_stats(revision)
request = Gitaly::CommitStatsRequest.new(
repository: @gitaly_repo,
......
......@@ -252,31 +252,6 @@ describe Gitlab::GitalyClient::CommitService do
end
end
describe '#patch' do
let(:request) do
Gitaly::CommitPatchRequest.new(
repository: repository_message, revision: revision
)
end
let(:response) { [double(data: "my "), double(data: "diff")] }
subject { described_class.new(repository).patch(revision) }
it 'sends an RPC request' do
expect_any_instance_of(Gitaly::DiffService::Stub).to receive(:commit_patch)
.with(request, kind_of(Hash)).and_return([])
subject
end
it 'concatenates the responses data' do
allow_any_instance_of(Gitaly::DiffService::Stub).to receive(:commit_patch)
.with(request, kind_of(Hash)).and_return(response)
expect(subject).to eq("my diff")
end
end
describe '#commit_stats' do
let(:request) do
Gitaly::CommitStatsRequest.new(
......
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