Commit 54587093 authored by Patrick Steinhardt's avatar Patrick Steinhardt

repository: Drop `#delete_config` function

The `#delete_config` function is not used anymore, and Gitaly has
deprecated direct access to the gitconfig in favor of more specialized
RPCs. Remove `#delete_config`.

Note that we do not yet delete `#set_config`: it's still in use to set
"gitlab.fullpath". This usecase will be addressed via a new
`SetFullPath()` RPC, at which point in time we can also remove
`#set_config`.
parent d33d1085
......@@ -924,12 +924,6 @@ module Gitlab
end
end
def delete_config(*keys)
wrapped_gitaly_errors do
gitaly_repository_client.delete_config(keys)
end
end
def disconnect_alternates
wrapped_gitaly_errors do
gitaly_repository_client.disconnect_alternates
......
......@@ -285,22 +285,6 @@ module Gitlab
nil
end
def delete_config(keys)
return if keys.empty?
request = Gitaly::DeleteConfigRequest.new(repository: @gitaly_repo, keys: keys)
GitalyClient.call(
@storage,
:repository_service,
:delete_config,
request,
timeout: GitalyClient.fast_timeout
)
nil
end
def license_short_name
request = Gitaly::FindLicenseRequest.new(repository: @gitaly_repo)
......
......@@ -1815,34 +1815,6 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
end
end
describe '#delete_config' do
let(:repository) { mutable_repository }
let(:entries) do
{
'test.foo1' => 'bla bla',
'test.foo2' => 1234,
'test.foo3' => true
}
end
it 'can delete config settings' do
entries.each do |key, value|
repository_rugged.config[key] = value
end
expect(repository.delete_config(*%w[does.not.exist test.foo1 test.foo2])).to be_nil
# Workaround for https://github.com/libgit2/rugged/issues/785: If
# Gitaly changes .gitconfig while Rugged has the file loaded
# Rugged::Repository#each_key will report stale values unless a
# lookup is done first.
expect(repository_rugged.config['test.foo1']).to be_nil
config_keys = repository_rugged.config.each_key.to_a
expect(config_keys).not_to include('test.foo1')
expect(config_keys).not_to include('test.foo2')
end
end
describe '#merge_to_ref' do
let(:repository) { mutable_repository }
let(:branch_head) { '6d394385cf567f80a8fd85055db1ab4c5295806f' }
......
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