Commit e0a27ee4 authored by Stan Hu's avatar Stan Hu

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

Migrate to Project#empty_repo?

Closes #41326

See merge request gitlab-org/gitlab-ce!16054
parents f5290c97 338f1eaf
---
title: Fix GitHub importer using removed interface
merge_request:
author:
type: fixed
...@@ -29,7 +29,7 @@ module Gitlab ...@@ -29,7 +29,7 @@ module Gitlab
# this code, e.g. because we had to retry this job after # 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 # `import_wiki?` raised a rate limit error. In this case we'll skip
# re-importing the main repository. # re-importing the main repository.
if project.repository.empty_repo? if project.empty_repo?
import_repository import_repository
else else
true true
......
...@@ -70,7 +70,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do ...@@ -70,7 +70,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
describe '#execute' do describe '#execute' do
it 'imports the repository and wiki' do it 'imports the repository and wiki' do
expect(repository) expect(project)
.to receive(:empty_repo?) .to receive(:empty_repo?)
.and_return(true) .and_return(true)
...@@ -93,7 +93,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do ...@@ -93,7 +93,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
end end
it 'does not import the repository if it already exists' do it 'does not import the repository if it already exists' do
expect(repository) expect(project)
.to receive(:empty_repo?) .to receive(:empty_repo?)
.and_return(false) .and_return(false)
...@@ -115,7 +115,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do ...@@ -115,7 +115,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
end end
it 'does not import the wiki if it is disabled' do it 'does not import the wiki if it is disabled' do
expect(repository) expect(project)
.to receive(:empty_repo?) .to receive(:empty_repo?)
.and_return(true) .and_return(true)
...@@ -137,7 +137,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do ...@@ -137,7 +137,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
end end
it 'does not import the wiki if the repository could not be imported' do it 'does not import the wiki if the repository could not be imported' do
expect(repository) expect(project)
.to receive(:empty_repo?) .to receive(:empty_repo?)
.and_return(true) .and_return(true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment