Commit 19fdd373 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'pks-gitaly-remove-between-commits-wrapper' into 'master'

gitaly: Remove CommitsBetween wrapper

See merge request gitlab-org/gitlab!74407
parents a0fd5611 2e417f1c
---
name: between_commits_via_list_commits
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74273
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/345458
milestone: '14.5'
type: development
group: group::gitaly
default_enabled: false
......@@ -204,19 +204,6 @@ module Gitlab
Gitlab::Git::Commit.new(@repository, gitaly_commit)
end
def between(from, to)
return list_commits(["^" + from, to], reverse: true) if Feature.enabled?(:between_commits_via_list_commits)
request = Gitaly::CommitsBetweenRequest.new(
repository: @gitaly_repo,
from: from,
to: to
)
response = GitalyClient.call(@repository.storage, :commit_service, :commits_between, request, timeout: GitalyClient.medium_timeout)
consume_commits_response(response)
end
def diff_stats(left_commit_sha, right_commit_sha)
request = Gitaly::DiffStatsRequest.new(
repository: @gitaly_repo,
......
......@@ -108,45 +108,6 @@ RSpec.describe Gitlab::GitalyClient::CommitService do
end
end
describe '#between' do
let(:from) { 'master' }
let(:to) { Gitlab::Git::EMPTY_TREE_ID }
context 'with between_commits_via_list_commits enabled' do
before do
stub_feature_flags(between_commits_via_list_commits: true)
end
it 'sends an RPC request' do
request = Gitaly::ListCommitsRequest.new(
repository: repository_message, revisions: ["^" + from, to], reverse: true
)
expect_any_instance_of(Gitaly::CommitService::Stub).to receive(:list_commits)
.with(request, kind_of(Hash)).and_return([])
described_class.new(repository).between(from, to)
end
end
context 'with between_commits_via_list_commits disabled' do
before do
stub_feature_flags(between_commits_via_list_commits: false)
end
it 'sends an RPC request' do
request = Gitaly::CommitsBetweenRequest.new(
repository: repository_message, from: from, to: to
)
expect_any_instance_of(Gitaly::CommitService::Stub).to receive(:commits_between)
.with(request, kind_of(Hash)).and_return([])
described_class.new(repository).between(from, to)
end
end
end
describe '#diff_stats' do
let(:left_commit_id) { 'master' }
let(:right_commit_id) { 'cfe32cf61b73a0d5e9f13e774abde7ff789b1660' }
......
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