Commit d33d1085 authored by Patrick Steinhardt's avatar Patrick Steinhardt

repository: Drop `#with_config` function

The `#with_config` function is not used anymore, and Gitaly has
deprecated direct access to the gitconfig in favor of more specialized
RPCs. Remove the function.
parent 0c8a5439
......@@ -17,15 +17,6 @@ module EE
delegate :checksum, :find_remote_root_ref, to: :raw_repository
end
# Transiently sets a configuration variable
def with_config(values = {})
raw_repository.set_config(values)
yield
ensure
raw_repository.delete_config(*values.keys)
end
# Runs code after a repository has been synced.
def after_sync
expire_all_method_caches
......
......@@ -62,35 +62,6 @@ RSpec.describe Repository do
end
end
describe '#with_config' do
let(:rugged) { rugged_repo(repository) }
let(:entries) do
{
'test.foo1' => 'hello',
'test.foo2' => 'world',
'http.http://gitlab-primary.geo/gitlab-qa-sandbox-group/qa-test-10-07-2018-07-22-41/geo-project-ac55ec2cd134afea.wiki.git.extraHeader' => 'Authorization: blabla'
}
end
it 'sets config only during the block' do
keys_should_not_be_set
repository.with_config(entries) do
entries.each do |key, value|
expect(rugged.config[key]).to eq(value)
end
end
keys_should_not_be_set
end
def keys_should_not_be_set
entries.each do |key, value|
expect(rugged.config[key]).to be_blank
end
end
end
describe "Elastic search", :elastic do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
......
......@@ -37,7 +37,6 @@ RSpec.describe Geo::WikiSyncService, :geo do
include_context 'lease handling'
it 'fetches wiki repository with JWT credentials' do
expect(repository).to receive(:with_config).with("http.#{url_to_repo}.extraHeader" => anything).and_call_original
expect(repository).to receive(:fetch_as_mirror)
.with(url_to_repo, forced: true, http_authorization_header: anything)
.once
......
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