From 39ae9a59a59615092fbef189466f37c34f4a7fb1 Mon Sep 17 00:00:00 2001 From: Mark Chao Date: Thu, 6 Sep 2018 12:34:25 +0800 Subject: 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. --- lib/gitlab/blame.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/gitlab/blame.rb') 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 -- cgit v1.2.3