Commit 4853c677 authored by Julian K's avatar Julian K

Update gitlab_shell.rb

using instance_variable_defined to avoid @user_tried
parent d3c3fbc6
......@@ -10,7 +10,6 @@ class GitlabShell
@origin_cmd = ENV['SSH_ORIGINAL_COMMAND']
@config = GitlabConfig.new
@repos_path = @config.repos_path
@user_tried = false
end
def exec
......@@ -70,10 +69,9 @@ class GitlabShell
def user
# Can't use "@user ||=" because that will keep hitting the API when @user is really nil!
if @user_tried
if instance_variable_defined?('@user')
@user
else
@user_tried = true
@user = api.discover(@key_id)
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