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:
authorMark Chao <mchao@gitlab.com>2018-09-06 05:59:52 +0300
committerMark Chao <mchao@gitlab.com>2018-10-30 10:44:55 +0300
commit6580de78bb52323fcafaaf4d2e770590e4f1c586 (patch)
treee310ab5c7342b82c1ce89d7653871b26758e88fd /lib/gitlab/search_results.rb
parent6f0378485761ae476bf373b7cddb611da05caa9d (diff)
Add access to Blob's language from gitattributes
Ported from Highlight class since it as a concept is more related to blob, and this allows more flexibility.
Diffstat (limited to 'lib/gitlab/search_results.rb')
-rw-r--r--lib/gitlab/search_results.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/search_results.rb b/lib/gitlab/search_results.rb
index 5ce3eda2ccb..f2795c739f5 100644
--- a/lib/gitlab/search_results.rb
+++ b/lib/gitlab/search_results.rb
@@ -25,6 +25,12 @@ module Gitlab
def no_highlighting?
false
end
+
+ # Since search results often contain many items,
+ # not triggering lookup can avoid n+1 queries.
+ def language_from_gitattributes
+ nil
+ end
end
attr_reader :current_user, :query, :per_page