Commit 190a6a1e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'jc-remove-old-code-path-search-files' into 'master'

Removing old code path for search_files_by_content

See merge request gitlab-org/gitlab-ce!25617
parents c1b50f85 87adc799
1.21.0 1.23.0
\ No newline at end of file
...@@ -324,8 +324,8 @@ module Gitlab ...@@ -324,8 +324,8 @@ module Gitlab
GitalyClient.call(@storage, :repository_service, :search_files_by_name, request, timeout: GitalyClient.fast_timeout).flat_map(&:files) GitalyClient.call(@storage, :repository_service, :search_files_by_name, request, timeout: GitalyClient.fast_timeout).flat_map(&:files)
end end
def search_files_by_content(ref, query, chunked_response: true) def search_files_by_content(ref, query)
request = Gitaly::SearchFilesByContentRequest.new(repository: @gitaly_repo, ref: ref, query: query, chunked_response: chunked_response) request = Gitaly::SearchFilesByContentRequest.new(repository: @gitaly_repo, ref: ref, query: query)
response = GitalyClient.call(@storage, :repository_service, :search_files_by_content, request) response = GitalyClient.call(@storage, :repository_service, :search_files_by_content, request)
search_results_from_response(response) search_results_from_response(response)
...@@ -340,12 +340,6 @@ module Gitlab ...@@ -340,12 +340,6 @@ module Gitlab
gitaly_response.each do |message| gitaly_response.each do |message|
next if message.nil? next if message.nil?
# Old client will ignore :chunked_response flag
# and return messages with `matches` key.
# This code path will be removed post 12.0 release
if message.matches.any?
matches += message.matches
else
current_match << message.match_data current_match << message.match_data
if message.end_of_match if message.end_of_match
...@@ -353,7 +347,6 @@ module Gitlab ...@@ -353,7 +347,6 @@ module Gitlab
current_match = +"" current_match = +""
end end
end end
end
matches matches
end end
......
...@@ -619,16 +619,6 @@ describe Gitlab::Git::Repository, :seed_helper do ...@@ -619,16 +619,6 @@ describe Gitlab::Git::Repository, :seed_helper do
repository.search_files_by_content('search-files-by-content', 'search-files-by-content-branch') repository.search_files_by_content('search-files-by-content', 'search-files-by-content-branch')
end end
end end
it_should_behave_like 'search files by content' do
let(:search_results) do
repository.gitaly_repository_client.search_files_by_content(
'search-files-by-content-branch',
'search-files-by-content',
chunked_response: false
)
end
end
end end
describe '#find_remote_root_ref' do describe '#find_remote_root_ref' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment