From 15a8fdb8142eb6a412f8ef772d742c399e91f12a Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 29 Sep 2017 17:20:56 -0700 Subject: Fix gitlab-rake gitlab:import:repos task Because of a change in GitLab 9.5.4 to prevent users from assuming control of a repository already on disk, the import task broke. Imports would fail with the message, "There is already a repository with that name on disk". This change skips the validation when the import is done from the command-line. Closes #37682 --- spec/models/project_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec/models/project_spec.rb') diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 868a843ab0a..07fad057cd2 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2793,6 +2793,17 @@ describe Project do end end + describe '#can_create_repository?' do + let(:project) { build(:project) } + + it 'skips gitlab-shell exists?' do + project.skip_disk_validation = true + + expect(project.gitlab_shell).not_to receive(:exists?) + expect(project.can_create_repository?).to be_truthy + end + end + describe '#latest_successful_pipeline_for_default_branch' do let(:project) { build(:project) } -- cgit v1.2.1