Commit bda0f09c authored by Ash McKenzie's avatar Ash McKenzie

GitAccessStatus initializer sensible defaults

parent 4801e2de
......@@ -3,7 +3,7 @@ require 'json'
class GitAccessStatus
attr_reader :message, :gl_repository, :gl_id, :gl_username, :gitaly, :git_protocol, :git_config_options
def initialize(status, message, gl_repository:, gl_id:, gl_username:, gitaly:, git_protocol:, git_config_options:)
def initialize(status, message, gl_repository: nil, gl_id: nil, gl_username: nil, gitaly: nil, git_protocol: nil, git_config_options: nil)
@status = status
@message = message
@gl_repository = gl_repository
......
......@@ -37,14 +37,7 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
when HTTP_SUCCESS, HTTP_UNAUTHORIZED, HTTP_NOT_FOUND
GitAccessStatus.create_from_json(resp.body)
else
GitAccessStatus.new(false,
'API is not accessible',
gl_repository: nil,
gl_id: nil,
gl_username: nil,
git_config_options: nil,
gitaly: nil,
git_protocol: nil)
GitAccessStatus.new(false, resp.code, 'API is not accessible')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment