Class: Gitlab::Gpg::Commit

Inherits:
SignedCommit show all
Defined in:
lib/gitlab/gpg/commit.rb

Instance Method Summary collapse

Methods inherited from SignedCommit

#initialize, #signature_text, #signed_text

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

This class inherits a constructor from Gitlab::SignedCommit

Instance Method Details

#signatureObject


6
7
8
9
10
11
12
13
14
15
# File 'lib/gitlab/gpg/commit.rb', line 6

def signature
  super

  return @signature if @signature

  cached_signature = lazy_signature&.itself
  return @signature = cached_signature if cached_signature.present?

  @signature = create_cached_signature!
end

#update_signature!(cached_signature) ⇒ Object


17
18
19
20
21
22
# File 'lib/gitlab/gpg/commit.rb', line 17

def update_signature!(cached_signature)
  using_keychain do |gpg_key|
    cached_signature.update!(attributes(gpg_key))
    @signature = cached_signature
  end
end