diff options
Diffstat (limited to 'lib/gitlab/lfs/client.rb')
-rw-r--r-- | lib/gitlab/lfs/client.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/lfs/client.rb b/lib/gitlab/lfs/client.rb index 825d7399190..a05e8107cad 100644 --- a/lib/gitlab/lfs/client.rb +++ b/lib/gitlab/lfs/client.rb @@ -43,7 +43,7 @@ module Gitlab body = Gitlab::Json.parse(rsp.body) transfer = body.fetch('transfer', 'basic') - raise UnsupportedTransferError.new(transfer.inspect) unless transfer == 'basic' + raise UnsupportedTransferError, transfer.inspect unless transfer == 'basic' body end @@ -97,7 +97,10 @@ module Gitlab end def basic_auth - return unless credentials[:auth_method] == "password" + # Some legacy credentials have a nil auth_method, which means password + # https://gitlab.com/gitlab-org/gitlab/-/issues/328674 + return unless credentials.fetch(:auth_method, 'password') == 'password' + return if credentials.empty? { username: credentials[:user], password: credentials[:password] } end |