Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-07-25 10:40:23 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 16:46:03 +0300
commiteda001565c5afbf6e2eb9b8b5cf4fa9d6525ed71 (patch)
tree44eb6484077618fa444fb85d4e0e8e6a2914430f /app/models/commit.rb
parentc4c44c6a1bb892dc17989cef3cc9b6c23fecb2c8 (diff)
fetch gpg signature badges by ajax
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb8
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