summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-12-20 19:24:50 +0000
committerStan Hu <stanhu@gmail.com>2017-12-20 19:24:50 +0000
commite0a27ee419b55509204ba2bfbdbfbab3c7c331bc (patch)
tree3be391cb00d0b947d60e39cc7bed2ddbf8f142fc
parentf5290c9738bbca7b130ddc86c0cdcc3f35e34c3a (diff)
parent338f1eaf354a31663afbda3d91776f7f506b90f1 (diff)
downloadgitlab-ce-e0a27ee419b55509204ba2bfbdbfbab3c7c331bc.tar.gz
Merge branch 'zj-empty-repo-importer' into 'master'
Migrate to Project#empty_repo? Closes #41326 See merge request gitlab-org/gitlab-ce!16054
-rw-r--r--changelogs/unreleased/zj-empty-repo-importer.yml5
-rw-r--r--lib/gitlab/github_import/importer/repository_importer.rb2
-rw-r--r--spec/lib/gitlab/github_import/importer/repository_importer_spec.rb8
3 files changed, 10 insertions, 5 deletions
diff --git a/changelogs/unreleased/zj-empty-repo-importer.yml b/changelogs/unreleased/zj-empty-repo-importer.yml
new file mode 100644
index 00000000000..71d50af9a04
--- /dev/null
+++ b/changelogs/unreleased/zj-empty-repo-importer.yml
@@ -0,0 +1,5 @@
+---
+title: Fix GitHub importer using removed interface
+merge_request:
+author:
+type: fixed
diff --git a/lib/gitlab/github_import/importer/repository_importer.rb b/lib/gitlab/github_import/importer/repository_importer.rb
index 9cf2e7fd871..7dd68a0d1cd 100644
--- a/lib/gitlab/github_import/importer/repository_importer.rb
+++ b/lib/gitlab/github_import/importer/repository_importer.rb
@@ -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
diff --git a/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb b/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb
index 168e5d07504..46a57e08963 100644
--- a/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb
@@ -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)