diff options
Diffstat (limited to 'app/controllers/import/github_controller.rb')
-rw-r--r-- | app/controllers/import/github_controller.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb index 8c6bdd16383..ee7d498c59c 100644 --- a/app/controllers/import/github_controller.rb +++ b/app/controllers/import/github_controller.rb @@ -40,11 +40,12 @@ class Import::GithubController < Import::BaseController def create @repo_id = params[:repo_id].to_i repo = client.repo(@repo_id) - @project_name = repo.name - @target_namespace = find_or_create_namespace(repo.owner.login, client.user.login) + @project_name = params[:new_name].presence || repo.name + namespace_path = params[:target_namespace].presence || current_user.namespace_path + @target_namespace = find_or_create_namespace(namespace_path, current_user.namespace_path) if current_user.can?(:create_projects, @target_namespace) - @project = Gitlab::GithubImport::ProjectCreator.new(repo, @target_namespace, current_user, access_params).execute + @project = Gitlab::GithubImport::ProjectCreator.new(repo, @project_name, @target_namespace, current_user, access_params).execute else render 'unauthorized' end |