diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-25 09:40:23 +0200 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 15:46:03 +0200 |
commit | eda001565c5afbf6e2eb9b8b5cf4fa9d6525ed71 (patch) | |
tree | 44eb6484077618fa444fb85d4e0e8e6a2914430f /app/models/commit.rb | |
parent | c4c44c6a1bb892dc17989cef3cc9b6c23fecb2c8 (diff) | |
download | gitlab-ce-eda001565c5afbf6e2eb9b8b5cf4fa9d6525ed71.tar.gz |
fetch gpg signature badges by ajax
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 35593d53cbc..7940733f557 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -237,9 +237,11 @@ class Commit def signature return @signature if defined?(@signature) - @signature = Gitlab::Gpg::Commit.new(self).signature + @signature = gpg_commit.signature end + delegate :has_signature?, to: :gpg_commit + def revert_branch_name "revert-#{short_id}" end @@ -388,4 +390,8 @@ class Commit def merged_merge_request_no_cache(user) MergeRequestsFinder.new(user, project_id: project.id).find_by(merge_commit_sha: id) if merge_commit? end + + def gpg_commit + @gpg_commit ||= Gitlab::Gpg::Commit.new(self) + end end |