diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-01-26 19:38:11 +0300 |
---|---|---|
committer | Ian Baum <ibaum@gitlab.com> | 2018-01-29 21:12:06 +0300 |
commit | 44cb95a471031773190dd7912529df47e27a767b (patch) | |
tree | 79362e39ce1858fc29124db6f886ffca8d82ffd5 /app/workers/repository_import_worker.rb | |
parent | b404ea4b5e19643bc859cb1e3c282f834d46ea7e (diff) |
Merge branch '42327-import-from-gitlab-com-fails-destination-already-exists-and-is-not-an-empty-directory-error' into 'master'
Resolve "Import from GitLab.com fails (destination already exists and is not an empty directory error)."
Closes #42327
See merge request gitlab-org/gitlab-ce!16714
Diffstat (limited to 'app/workers/repository_import_worker.rb')
-rw-r--r-- | app/workers/repository_import_worker.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/workers/repository_import_worker.rb b/app/workers/repository_import_worker.rb index 31e2798c36b..d79b5ee5346 100644 --- a/app/workers/repository_import_worker.rb +++ b/app/workers/repository_import_worker.rb @@ -20,7 +20,11 @@ class RepositoryImportWorker # to those importers to mark the import process as complete. return if service.async? - raise result[:message] if result[:status] == :error + if result[:status] == :error + fail_import(project, result[:message]) if project.gitlab_project_import? + + raise result[:message] + end project.after_import end @@ -33,4 +37,8 @@ class RepositoryImportWorker Rails.logger.info("Project #{project.full_path} was in inconsistent state (#{project.import_status}) while importing.") false end + + def fail_import(project, message) + project.mark_import_as_failed(message) + end end |