Skip to content
Snippets Groups Projects
Commit c136edbb authored by James Lopez's avatar James Lopez
Browse files

fix gitlab import and spec

parent 8aafe685
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -5,10 +5,13 @@ module Gitlab
 
def initialize(project)
@project = project
import_data = project.import_data.try(:data)
gitlab_session = import_data["gitlab_session"] if import_data
@client = Client.new(gitlab_session["gitlab_access_token"])
@formatter = Gitlab::ImportFormatter.new
credentials = import_data.credentials
if credentials && credentials["password"]
@client = Client.new(credentials["password"])
@formatter = Gitlab::ImportFormatter.new
else
raise Projects::ImportService::Error, "Unable to find project import data credentials for project ID: #{@project.id}"
end
end
 
def execute
Loading
Loading
Loading
Loading
@@ -23,7 +23,6 @@ module Gitlab
import_url: repo["http_url_to_repo"].sub("://", "://oauth2:#{@session_data[:gitlab_access_token]}@")
).execute
 
project.create_import_data(data: { "gitlab_session" => session_data } )
project
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment