diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-06-15 11:28:28 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 16:42:53 +0300 |
commit | 34810acd6c3d4dd27f43f6f07e47b4e06bb95f82 (patch) | |
tree | 85e29ac5cb80247e5d8236453170100dd2047cd2 /lib/gitlab/gpg | |
parent | 7b616d39efaa7cba933d17dfae010d393c18d057 (diff) |
move signature cache read to Gpg::Commit
as we write the cache in the gpg commit class already the read should
also happen there.
This also removes all logic from the main commit class, which just
proxies the call to the Gpg::Commit now.
Diffstat (limited to 'lib/gitlab/gpg')
-rw-r--r-- | lib/gitlab/gpg/commit.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/gpg/commit.rb b/lib/gitlab/gpg/commit.rb index d65a20f08f9..2b61caaebb5 100644 --- a/lib/gitlab/gpg/commit.rb +++ b/lib/gitlab/gpg/commit.rb @@ -16,6 +16,9 @@ module Gitlab def signature return unless has_signature? + cached_signature = GpgSignature.find_by(commit_sha: commit.sha) + return cached_signature if cached_signature.present? + Gitlab::Gpg.using_tmp_keychain do # first we need to get the keyid from the signature to query the gpg # key belonging to the keyid. |