summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-03-04 12:21:53 +0100
committerJames Lopez <james@jameslopez.es>2016-03-04 12:21:53 +0100
commit06b36c00d55df38cd2aaa4d5251185485c8abe5c (patch)
tree56f7f720a1e6dd7e7d336698586ad27fa3a7665a /lib
parentcefefb2adea23c81c5e6254992da975eca71b559 (diff)
downloadgitlab-ce-06b36c00d55df38cd2aaa4d5251185485c8abe5c.tar.gz
some refactoring in the migration. Also fixed github import issue and updated spec
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/github_import/project_creator.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/github_import/project_creator.rb b/lib/gitlab/github_import/project_creator.rb
index 474927069a5..d6cab3c2d24 100644
--- a/lib/gitlab/github_import/project_creator.rb
+++ b/lib/gitlab/github_import/project_creator.rb
@@ -20,13 +20,21 @@ module Gitlab
visibility_level: repo.private ? Gitlab::VisibilityLevel::PRIVATE : Gitlab::VisibilityLevel::PUBLIC,
import_type: "github",
import_source: repo.full_name,
- import_url: repo.clone_url.sub("https://", "https://#{@session_data[:github_access_token]}@"),
+ import_url: repo.clone_url,
wiki_enabled: !repo.has_wiki? # If repo has wiki we'll import it later
).execute
- project.create_import_data(data: { "github_session" => session_data } )
+ create_import_data(project)
project
end
+
+ private
+
+ def create_import_data(project)
+ project.create_import_data(
+ credentials: session_data.delete(:github_access_token),
+ data: { "github_session" => session_data })
+ end
end
end
end