summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-08-08 15:05:58 +0200
committerJames Lopez <james@jameslopez.es>2016-09-20 10:14:39 +0200
commit0c65112da79e177da3574458c3bb5befc349fd30 (patch)
treef3715fa7342143d1fd7bd53278c3ecf279e87c49 /lib/gitlab
parent95b9421ad3b2678da6e0af0131eafd52cdd0b2a5 (diff)
downloadgitlab-ce-0c65112da79e177da3574458c3bb5befc349fd30.tar.gz
modify github import JS and controller so we can now specify a namespace and/or name for a project.
- Fixed and added specs. - Added different namespace options depending on user privilages - Updated docs.
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/github_import/project_creator.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/github_import/project_creator.rb b/lib/gitlab/github_import/project_creator.rb
index e9725880c5e..605abfabdab 100644
--- a/lib/gitlab/github_import/project_creator.rb
+++ b/lib/gitlab/github_import/project_creator.rb
@@ -3,8 +3,9 @@ module Gitlab
class ProjectCreator
attr_reader :repo, :namespace, :current_user, :session_data
- def initialize(repo, namespace, current_user, session_data)
+ def initialize(repo, name, namespace, current_user, session_data)
@repo = repo
+ @name = name
@namespace = namespace
@current_user = current_user
@session_data = session_data
@@ -13,8 +14,8 @@ module Gitlab
def execute
project = ::Projects::CreateService.new(
current_user,
- name: repo.name,
- path: repo.name,
+ name: @name,
+ path: @name,
description: repo.description,
namespace_id: namespace.id,
visibility_level: repo.private ? Gitlab::VisibilityLevel::PRIVATE : ApplicationSetting.current.default_project_visibility,