Revert "Merge branch 'gitaly-with-config' into 'master'"

This reverts merge request !6428
parent 7abbde6e
...@@ -11,12 +11,17 @@ module EE ...@@ -11,12 +11,17 @@ module EE
end end
# Transiently sets a configuration variable # Transiently sets a configuration variable
# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1241
def with_config(values = {}) def with_config(values = {})
raw_repository.set_config(values) ::Gitlab::GitalyClient::StorageSettings.allow_disk_access do
values.each { |k, v| rugged.config[k] = v }
end
yield yield
ensure ensure
raw_repository.delete_config(*values.keys) ::Gitlab::GitalyClient::StorageSettings.allow_disk_access do
values.keys.each { |key| rugged.config.delete(key) }
end
end end
# Runs code after a repository has been synced. # Runs code after a repository has been synced.
......
...@@ -34,33 +34,6 @@ describe Repository do ...@@ -34,33 +34,6 @@ describe Repository do
end end
end end
describe '#with_config' do
let(:rugged) do
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
repository.rugged
end
end
let(:entries) { { 'test.foo1' => 'hello', 'test.foo2' => 'world' } }
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 describe "Elastic search", :elastic do
before do before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true) stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
......
...@@ -286,11 +286,7 @@ describe Geo::RepositorySyncService do ...@@ -286,11 +286,7 @@ describe Geo::RepositorySyncService do
subject.execute subject.execute
repo_path = Gitlab::GitalyClient::StorageSettings.allow_disk_access do expect(File.directory?(project.repository.path)).to be true
project.repository.path
end
expect(File.directory?(repo_path)).to be true
end end
it 'tries to redownload repo when force_redownload flag is set' do it 'tries to redownload repo when force_redownload flag is set' do
......
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