Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e3f1745a
Commit
e3f1745a
authored
Nov 10, 2021
by
Vasilii Iakliushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add memoization for gpg_signatures
parent
988dc4ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
lib/gitlab/gpg/commit.rb
lib/gitlab/gpg/commit.rb
+10
-12
No files found.
lib/gitlab/gpg/commit.rb
View file @
e3f1745a
...
...
@@ -48,7 +48,7 @@ module Gitlab
if
gpg_key
Gitlab
::
Gpg
::
CurrentKeyChain
.
add
(
gpg_key
.
key
)
clear_memoization
(
:
verified_signature
)
clear_memoization
(
:
gpg_signatures
)
end
yield
gpg_key
...
...
@@ -56,10 +56,6 @@ module Gitlab
end
def
verified_signature
strong_memoize
(
:verified_signature
)
{
gpgme_signature
}
end
def
gpgme_signature
gpg_signatures
.
first
end
...
...
@@ -73,15 +69,17 @@ module Gitlab
end
def
gpg_signatures
signatures
=
[]
strong_memoize
(
:gpg_signatures
)
do
signatures
=
[]
GPGME
::
Crypto
.
new
.
verify
(
signature_text
,
signed_text:
signed_text
)
do
|
verified_signature
|
signatures
<<
verified_signature
end
GPGME
::
Crypto
.
new
.
verify
(
signature_text
,
signed_text:
signed_text
)
do
|
verified_signature
|
signatures
<<
verified_signature
end
signatures
rescue
GPGME
::
Error
[]
signatures
rescue
GPGME
::
Error
[]
end
end
def
multiple_signatures?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment