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