diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-07-26 14:21:53 +0200 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-07-28 11:32:46 +0200 |
commit | 1d3815f89b9b9f5ecfd6dd15158a2988603b9ed8 (patch) | |
tree | a694e1e05f58fc3fe5ae00135d4a439eef7c8150 /app/controllers/import/gitlab_projects_controller.rb | |
parent | d964816b9fe56679ffc0b331e701f7b24db5c6a9 (diff) | |
download | gitlab-ce-1d3815f89b9b9f5ecfd6dd15158a2988603b9ed8.tar.gz |
Allow projects to be started from a template
Started implementation for the first iteration of
gitlab-org/gitlab-ce#32420. This will allow users to select a template
to start with, instead of an empty repository in the project just
created.
Internally this is basically a small extension of the ImportExport
GitLab projects we already support. We just import a certain import
tar archive. This commits includes the first one: Ruby on Rails. In the
future more will be added.
Diffstat (limited to 'app/controllers/import/gitlab_projects_controller.rb')
-rw-r--r-- | app/controllers/import/gitlab_projects_controller.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index 36d246d185b..6463d2dfd5b 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -12,15 +12,7 @@ class Import::GitlabProjectsController < Import::BaseController return redirect_back_or_default(options: { alert: "You need to upload a GitLab project export archive." }) end - import_upload_path = Gitlab::ImportExport.import_upload_path(filename: project_params[:file].original_filename) - - FileUtils.mkdir_p(File.dirname(import_upload_path)) - FileUtils.copy_entry(project_params[:file].path, import_upload_path) - - @project = Gitlab::ImportExport::ProjectCreator.new(project_params[:namespace_id], - current_user, - import_upload_path, - project_params[:path]).execute + @project = ::Projects::GitlabProjectsImporterService.new(current_user, project_params).execute if @project.saved? redirect_to( |