diff options
author | Mark Chao <mchao@gitlab.com> | 2018-09-06 10:59:52 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-10-30 15:44:55 +0800 |
commit | 6580de78bb52323fcafaaf4d2e770590e4f1c586 (patch) | |
tree | e310ab5c7342b82c1ce89d7653871b26758e88fd /lib | |
parent | 6f0378485761ae476bf373b7cddb611da05caa9d (diff) | |
download | gitlab-ce-6580de78bb52323fcafaaf4d2e770590e4f1c586.tar.gz |
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')
-rw-r--r-- | lib/gitlab/search_results.rb | 6 |
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 |