diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/models/commit.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 83400c9e533..80dd02981c1 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -335,7 +335,11 @@ class Commit strong_memoize(:raw_signature_type) do next unless @raw.instance_of?(Gitlab::Git::Commit) - @raw.raw_commit.signature_type if defined? @raw.raw_commit.signature_type + if raw_commit_from_rugged? && gpg_commit.signature_text.present? + :PGP + elsif defined? @raw.raw_commit.signature_type + @raw.raw_commit.signature_type + end end end @@ -347,7 +351,7 @@ class Commit strong_memoize(:signature) do case signature_type when :PGP - Gitlab::Gpg::Commit.new(self).signature + gpg_commit.signature when :X509 Gitlab::X509::Commit.new(self).signature else @@ -356,6 +360,14 @@ class Commit end end + def raw_commit_from_rugged? + @raw.raw_commit.is_a?(Rugged::Commit) + end + + def gpg_commit + @gpg_commit ||= Gitlab::Gpg::Commit.new(self) + end + def revert_branch_name "revert-#{short_id}" end |