summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-28 19:21:24 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-28 19:21:24 +0200
commitff33e05bbe94bce3184fbbe7bb63cc4a4a511668 (patch)
tree03c77941baa3811b36f67b77a57714eb95e072cc
parent3a16acf364aa85e283ef10bbbaf6a5f558e5897e (diff)
parent4853c677e5fc9bdd431f50f6f5a4d40abaf8d2fd (diff)
downloadgitlab-shell-ff33e05bbe94bce3184fbbe7bb63cc4a4a511668.tar.gz
Merge pull request #81 from corny/patch-1
avoid @user_tried
-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 d0f23d7..e2cb2cc 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -12,7 +12,6 @@ class GitlabShell
@origin_cmd = ENV['SSH_ORIGINAL_COMMAND']
@config = GitlabConfig.new
@repos_path = @config.repos_path
- @user_tried = false
end
def exec
@@ -75,10 +74,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