Migrate to Project#empty_repo?

This commit is contained in:
Zeger-Jan van de Weg 2017-12-20 19:13:11 +01:00
parent f5290c9738
commit 338f1eaf35
No known key found for this signature in database
GPG Key ID: 65F6A8D64A88ABAC
3 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,5 @@
---
title: Fix GitHub importer using removed interface
merge_request:
author:
type: fixed

View File

@ -29,7 +29,7 @@ module Gitlab
# this code, e.g. because we had to retry this job after
# `import_wiki?` raised a rate limit error. In this case we'll skip
# re-importing the main repository.
if project.repository.empty_repo?
if project.empty_repo?
import_repository
else
true

View File

@ -70,7 +70,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
describe '#execute' do
it 'imports the repository and wiki' do
expect(repository)
expect(project)
.to receive(:empty_repo?)
.and_return(true)
@ -93,7 +93,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
end
it 'does not import the repository if it already exists' do
expect(repository)
expect(project)
.to receive(:empty_repo?)
.and_return(false)
@ -115,7 +115,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
end
it 'does not import the wiki if it is disabled' do
expect(repository)
expect(project)
.to receive(:empty_repo?)
.and_return(true)
@ -137,7 +137,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
end
it 'does not import the wiki if the repository could not be imported' do
expect(repository)
expect(project)
.to receive(:empty_repo?)
.and_return(true)