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:
authorNick Thomas <nick@gitlab.com>2018-09-04 15:51:02 +0300
committerNick Thomas <nick@gitlab.com>2018-09-06 14:28:56 +0300
commitd9833890cca2c8fb388cc020f626f9d2c09871a4 (patch)
treecc82691a5d13ee2e3f67bd3d026631bae983435d /app/models/commit.rb
parent228d819b5761de1e2362952a9d0f08828c88424d (diff)
Bulk-render commit titles in the tree view to improve performance
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 594972ad344..c993f3ed507 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -22,6 +22,7 @@ class Commit
attr_accessor :project, :author
attr_accessor :redacted_description_html
attr_accessor :redacted_title_html
+ attr_accessor :redacted_full_title_html
attr_reader :gpg_commit
DIFF_SAFE_LINES = Gitlab::Git::DiffCollection::DEFAULT_LIMITS[:max_lines]
@@ -38,7 +39,12 @@ class Commit
def banzai_render_context(field)
pipeline = field == :description ? :commit_description : :single_line
context = { pipeline: pipeline, project: self.project }
- context[:author] = self.author if self.author
+
+ # The author is only needed when rendering the description
+ if field == :description
+ author = self.author
+ context[:author] = author if author
+ end
context
end