diff --git a/lib/gitlab/bare_repository_import/repository.rb b/lib/gitlab/bare_repository_import/repository.rb index b5907875460..85b79362196 100644 --- a/lib/gitlab/bare_repository_import/repository.rb +++ b/lib/gitlab/bare_repository_import/repository.rb @@ -33,8 +33,9 @@ module Gitlab def processable? return false if wiki? + return false if hashed? && (group_path.blank? || project_name.blank?) - group_path.present? && project_name.present? + true end private diff --git a/spec/lib/gitlab/bare_repository_import/repository_spec.rb b/spec/lib/gitlab/bare_repository_import/repository_spec.rb index 770e26bbf6a..e0b7d16ebb7 100644 --- a/spec/lib/gitlab/bare_repository_import/repository_spec.rb +++ b/spec/lib/gitlab/bare_repository_import/repository_spec.rb @@ -27,7 +27,13 @@ describe ::Gitlab::BareRepositoryImport::Repository do expect(subject.processable?).to eq(false) end - it 'returns true when group and project name are present' do + it 'returns true if group path is missing' do + subject = described_class.new('/full/path/', '/full/path/repo.git') + + expect(subject.processable?).to eq(true) + end + + it 'returns true when group path and project name are present' do expect(subject.processable?).to eq(true) end end @@ -97,7 +103,7 @@ describe ::Gitlab::BareRepositoryImport::Repository do expect(subject.processable?).to eq(false) end - it 'returns true when group and project name are present' do + it 'returns true when group path and project name are present' do expect(subject.processable?).to eq(true) end end