no need for passing parameter

we introduced memoizing, so it's safe to call the method multiple times.
This commit is contained in:
Alexis Reigel 2017-06-16 14:37:28 +02:00
parent e75ab06430
commit d7f4264368

View file

@ -32,7 +32,7 @@ module Gitlab
def update_signature!(cached_signature) def update_signature!(cached_signature)
using_keychain do |gpg_key| using_keychain do |gpg_key|
cached_signature.update_attributes!( cached_signature.update_attributes!(
valid_signature: self.class.gpg_signature_valid_signature_value(gpg_key, verified_signature) valid_signature: gpg_signature_valid_signature_value(gpg_key)
) )
end end
end end
@ -67,12 +67,12 @@ module Gitlab
project: commit.project, project: commit.project,
gpg_key: gpg_key, gpg_key: gpg_key,
gpg_key_primary_keyid: gpg_key&.primary_keyid || verified_signature.fingerprint, gpg_key_primary_keyid: gpg_key&.primary_keyid || verified_signature.fingerprint,
valid_signature: self.class.gpg_signature_valid_signature_value(gpg_key, verified_signature) valid_signature: gpg_signature_valid_signature_value(gpg_key)
) )
end end
def self.gpg_signature_valid_signature_value(gpg_key, verified_signature_) def gpg_signature_valid_signature_value(gpg_key)
!!(gpg_key && gpg_key.verified? && verified_signature_.valid?) !!(gpg_key && gpg_key.verified? && verified_signature.valid?)
end end
end end
end end