summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
authorJulian K. <jk+github@digineo.de>2013-08-07 11:25:39 +0200
committerJulian K. <jk+github@digineo.de>2013-08-07 11:25:39 +0200
commit4853c677e5fc9bdd431f50f6f5a4d40abaf8d2fd (patch)
tree5d7fa4215e7d6afe060f82b81ad9c4d7a5431177 /lib/gitlab_shell.rb
parentd3c3fbc6163ca13b16351214349bd5a7f5b729a3 (diff)
downloadgitlab-shell-4853c677e5fc9bdd431f50f6f5a4d40abaf8d2fd.tar.gz
Update gitlab_shell.rb
using instance_variable_defined to avoid @user_tried
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 01ef4a1..08022c5 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -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