diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-31 11:03:46 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-09-15 12:21:00 -0500 |
commit | 85152f0291b7e6dd4a92a068e7d5c4334df54e80 (patch) | |
tree | 5e619012c1ebb274923d3dbef961cc40e886086b | |
parent | c25630ee2c2804e351a2c3ae4fd9224434e4698a (diff) | |
download | gitlab-ce-85152f0291b7e6dd4a92a068e7d5c4334df54e80.tar.gz |
Improve string handling.
-rw-r--r-- | lib/gitlab/auth.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index 821c0ef87e9..02b33c8c683 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -118,8 +118,8 @@ module Gitlab def lfs_token_check(login, password) actor = - if login.include?('lfs-deploy-key') - DeployKey.find(login.gsub('lfs-deploy-key-', '')) + if login.start_with?('lfs-deploy-key') + DeployKey.find(login.sub('lfs-deploy-key-', '')) else User.by_login(login) end |