diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-24 00:11:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-24 00:11:46 +0300 |
commit | 66e3f84f5200d00e3ce3137dad80592096ef3401 (patch) | |
tree | d564786eec6b40a17c8450051887f949517d2454 /app/models/commit.rb | |
parent | 5421d61b1d5ffe11a9c7afbe2259b4e4d0e7c993 (diff) |
Add latest changes from gitlab-org/gitlab@master
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 |