diff options
author | James Lopez <james@jameslopez.es> | 2016-06-24 11:50:23 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-06-24 11:50:23 +0300 |
commit | 46b89a270f7eef15f6d8e41c79600795265054fb (patch) | |
tree | e842e005b4a24d52d3ab99e3d17ba51032c42de2 /app/controllers/import/gitlab_projects_controller.rb | |
parent | 4477dc249e563e60e126d4f5ad2692297a9584c1 (diff) |
Fix tmp file being deleted after the request plus some cleanup and improved erroring for this situation
Diffstat (limited to 'app/controllers/import/gitlab_projects_controller.rb')
-rw-r--r-- | app/controllers/import/gitlab_projects_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index f99aa490d3e..b521daa03aa 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -12,9 +12,13 @@ class Import::GitlabProjectsController < Import::BaseController return redirect_back_or_default(options: { alert: "You need to upload a GitLab project export archive." }) end + imported_file = params[:file].path + "-import" + + FileUtils.copy_entry(params[:file].path, imported_file) + @project = Gitlab::ImportExport::ProjectCreator.new(project_params[:namespace_id], current_user, - File.expand_path(project_params[:file].path), + File.expand_path(imported_file), project_params[:path]).execute if @project.saved? |