summaryrefslogtreecommitdiff
path: root/lib/gitlab/blame.rb
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-09-06 12:34:25 +0800
committerMark Chao <mchao@gitlab.com>2018-10-30 15:44:55 +0800
commit39ae9a59a59615092fbef189466f37c34f4a7fb1 (patch)
treec8611265f8fb290cbce92f04cadb593b531165ee /lib/gitlab/blame.rb
parent32f9cf8ce3dd337bf3b1683c5872171c253f0d27 (diff)
downloadgitlab-ce-39ae9a59a59615092fbef189466f37c34f4a7fb1.tar.gz
Make Highlight accept language param
This replaces the repository param. This allows more flexiblity as sometimes we have highlight content not related to repository. Sometimes we know ahead of time the language of the content. Lastly language determination seems better fit as a logic in the Blob class. `repository` param is only used to determine the language, which seems to be the responsiblity of Blob.
Diffstat (limited to 'lib/gitlab/blame.rb')
-rw-r--r--lib/gitlab/blame.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/gitlab/blame.rb b/lib/gitlab/blame.rb
index 0d79594363e..f1a653a9d95 100644
--- a/lib/gitlab/blame.rb
+++ b/lib/gitlab/blame.rb
@@ -43,8 +43,7 @@ module Gitlab
def highlighted_lines
@blob.load_all_data!
- @highlighted_lines ||=
- Gitlab::Highlight.highlight(@blob.path, @blob.data, repository: repository).lines
+ @highlighted_lines ||= @blob.present.highlight.lines
end
def project