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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 21:09:39 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 21:09:39 +0300
commit00fa950a34b1c94617110b150b8b2517d5241249 (patch)
tree8f2d8683879079da8f520f7867ebd49b8beaadef /app/controllers/search_controller.rb
parentc36152ff8c41fad2f413f253eb7ac5c927e47c56 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb11
1 files changed, 11 insertions, 0 deletions
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