From 00fa950a34b1c94617110b150b8b2517d5241249 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 13 Mar 2020 18:09:39 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/search_controller.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 04d2b3068da..d1e15a72350 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -5,6 +5,7 @@ class SearchController < ApplicationController include SearchHelper include RendersCommits + before_action :override_snippet_scope, only: :show around_action :allow_gitaly_ref_name_caching skip_before_action :authenticate_user! @@ -103,4 +104,14 @@ class SearchController < ApplicationController Gitlab::UsageDataCounters::SearchCounter.increment_navbar_searches_count end + + # Disallow web snippet_blobs search as we migrate snippet + # from database-backed storage to git repository-based, + # and searching across multiple git repositories is not feasible. + # + # TODO: after 13.0 refactor this into Search::SnippetService + # See https://gitlab.com/gitlab-org/gitlab/issues/208882 + def override_snippet_scope + params[:scope] = 'snippet_titles' if params[:snippets] == 'true' + end end -- cgit v1.2.3