Fix Repository#processable? to allow .git repos in the root folder
This commit is contained in:
parent
2af3400c4e
commit
58c2f3b579
2 changed files with 10 additions and 3 deletions
|
@ -33,8 +33,9 @@ module Gitlab
|
||||||
|
|
||||||
def processable?
|
def processable?
|
||||||
return false if wiki?
|
return false if wiki?
|
||||||
|
return false if hashed? && (group_path.blank? || project_name.blank?)
|
||||||
|
|
||||||
group_path.present? && project_name.present?
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -27,7 +27,13 @@ describe ::Gitlab::BareRepositoryImport::Repository do
|
||||||
expect(subject.processable?).to eq(false)
|
expect(subject.processable?).to eq(false)
|
||||||
end
|
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)
|
expect(subject.processable?).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -97,7 +103,7 @@ describe ::Gitlab::BareRepositoryImport::Repository do
|
||||||
expect(subject.processable?).to eq(false)
|
expect(subject.processable?).to eq(false)
|
||||||
end
|
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)
|
expect(subject.processable?).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue