diff options
author | George Tsiolis <tsiolis.g@gmail.com> | 2018-02-12 16:57:25 +0300 |
---|---|---|
committer | George Tsiolis <tsiolis.g@gmail.com> | 2018-02-12 18:45:12 +0300 |
commit | ca5b4e3de225673ff3fbf27f38f83a1d843c152d (patch) | |
tree | 0ad09a15021a1f6879ddd2e2cf5e9a5dc5aca05c /app/services/projects/gitlab_projects_import_service.rb | |
parent | 7611ec4eef7d543b9e32894a015c5b0a4c5caeec (diff) |
Update projects import service
- Remove Gitlab::ImportExport::ProjectCreator from GitlabProjectsImportService
- Override ::Projects::CreateService params
Diffstat (limited to 'app/services/projects/gitlab_projects_import_service.rb')
-rw-r--r-- | app/services/projects/gitlab_projects_import_service.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/services/projects/gitlab_projects_import_service.rb b/app/services/projects/gitlab_projects_import_service.rb index a3d7f5cbed5..a68ecb4abe1 100644 --- a/app/services/projects/gitlab_projects_import_service.rb +++ b/app/services/projects/gitlab_projects_import_service.rb @@ -11,12 +11,14 @@ module Projects def execute FileUtils.mkdir_p(File.dirname(import_upload_path)) + + file = params.delete(:file) FileUtils.copy_entry(file.path, import_upload_path) - Gitlab::ImportExport::ProjectCreator.new(params[:namespace_id], - current_user, - import_upload_path, - params[:path]).execute + params[:import_type] = 'gitlab_project' + params[:import_source] = import_upload_path + + ::Projects::CreateService.new(current_user, params).execute end private @@ -28,9 +30,5 @@ module Projects def tmp_filename SecureRandom.hex end - - def file - params[:file] - end end end |