Merge branch 'zj-empty-repo-importer' into 'master'

Migrate to Project#empty_repo?

Closes #41326

See merge request gitlab-org/gitlab-ce!16054
This commit is contained in:
Stan Hu 2017-12-20 19:24:50 +00:00
commit e0a27ee419
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)