diff options
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 54de45ebba7..5175842e5de 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -359,6 +359,10 @@ class Commit end def has_signature? + if signature_type == :SSH && !ssh_signatures_enabled? + return false + end + signature_type && signature_type != :NONE end @@ -378,6 +382,10 @@ class Commit @signature_type ||= raw_signature_type || :NONE end + def ssh_signatures_enabled? + Feature.enabled?(:ssh_commit_signatures, project) + end + def signature strong_memoize(:signature) do case signature_type @@ -385,6 +393,8 @@ class Commit gpg_commit.signature when :X509 Gitlab::X509::Commit.new(self).signature + when :SSH + Gitlab::Ssh::Commit.new(self).signature if ssh_signatures_enabled? else nil end |