summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-07-17 20:45:06 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-08-07 13:06:13 -0300
commit4caa4293742cbe15c68c5d5882637fd6bf8816cf (patch)
treeddd7bfe6ffe0b0357c7acc465130dff0a2a93889
parent812620527ffee70ad2320eebcaec161a007b9d67 (diff)
downloadgitlab-ce-4caa4293742cbe15c68c5d5882637fd6bf8816cf.tar.gz
Set the GitHub API token on options hash
-rw-r--r--lib/github/import.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb
index 8ca7b678633..fa2c6790ba7 100644
--- a/lib/github/import.rb
+++ b/lib/github/import.rb
@@ -44,13 +44,13 @@ module Github
attr_reader :project, :repository, :repo, :repo_url, :wiki_url,
:options, :errors, :cached, :verbose
- def initialize(project, options)
+ def initialize(project, options = {})
@project = project
@repository = project.repository
@repo = project.import_source
@repo_url = project.import_url
@wiki_url = project.import_url.sub(/\.git\z/, '.wiki.git')
- @options = options
+ @options = options.reverse_merge(token: project.import_data&.credentials&.fetch(:user))
@verbose = options.fetch(:verbose, false)
@cached = Hash.new { |hash, key| hash[key] = Hash.new }
@errors = []