Write Config is mandatory

Closes https://gitlab.com/gitlab-org/gitaly/issues/879
This commit is contained in:
Zeger-Jan van de Weg 2018-06-25 15:08:20 +02:00
parent 901159bbae
commit 0855478726
No known key found for this signature in database
GPG key ID: 65F6A8D64A88ABAC
2 changed files with 28 additions and 44 deletions

View file

@ -1268,16 +1268,10 @@ module Gitlab
return unless full_path.present?
# This guard avoids Gitaly log/error spam
unless exists?
raise NoRepository, 'repository does not exist'
end
raise NoRepository, 'repository does not exist' unless exists?
gitaly_migrate(:write_config) do |is_enabled|
if is_enabled
wrapped_gitaly_errors do
gitaly_repository_client.write_config(full_path: full_path)
else
rugged_write_config(full_path: full_path)
end
end
end

View file

@ -1871,7 +1871,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
repository_rugged.config["gitlab.fullpath"] = repository_path
end
shared_examples 'writing repo config' do
context 'is given a path' do
it 'writes it to disk' do
repository.write_config(full_path: "not-the/real-path.git")
@ -1907,15 +1906,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
context "when gitaly_write_config is enabled" do
it_behaves_like "writing repo config"
end
context "when gitaly_write_config is disabled", :disable_gitaly do
it_behaves_like "writing repo config"
end
end
describe '#merge' do
let(:repository) do
Gitlab::Git::Repository.new('default', TEST_MUTABLE_REPO_PATH, '')