Commit 4f7ba8f2 authored by Alexis Reigel's avatar Alexis Reigel

fix memoization

parent 36c05b31
...@@ -22,7 +22,6 @@ module Gitlab ...@@ -22,7 +22,6 @@ module Gitlab
using_keychain do |gpg_key| using_keychain do |gpg_key|
if gpg_key if gpg_key
Gitlab::Gpg::CurrentKeyChain.add(gpg_key.key) Gitlab::Gpg::CurrentKeyChain.add(gpg_key.key)
@verified_signature = nil
end end
create_cached_signature!(gpg_key) create_cached_signature!(gpg_key)
...@@ -50,6 +49,7 @@ module Gitlab ...@@ -50,6 +49,7 @@ module Gitlab
if gpg_key if gpg_key
Gitlab::Gpg::CurrentKeyChain.add(gpg_key.key) Gitlab::Gpg::CurrentKeyChain.add(gpg_key.key)
@verified_signature = nil
end end
yield gpg_key yield gpg_key
...@@ -58,7 +58,7 @@ module Gitlab ...@@ -58,7 +58,7 @@ module Gitlab
def verified_signature def verified_signature
@verified_signature ||= GPGME::Crypto.new.verify(@signature_text, signed_text: @signed_text) do |verified_signature| @verified_signature ||= GPGME::Crypto.new.verify(@signature_text, signed_text: @signed_text) do |verified_signature|
return verified_signature break verified_signature
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment