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:
authorJohn Cai <jcai@gitlab.com>2019-02-28 00:37:33 +0300
committerJohn Cai <jcai@gitlab.com>2019-03-02 02:25:30 +0300
commit87adc799ebeb5b69f398e9a4ed37640a0d8c6c44 (patch)
treee7bef579861a09fc8325d10f6521ce72f339b3c9 /lib/gitlab/gitaly_client/repository_service.rb
parent5c9aa45489aee7cd1edaa15a30fb8a3aa24417a8 (diff)
Removing old code path for search_files_by_content
In 11.8, we added a fix for the SearchFilesByContent RPC in gitaly to send back the response in chunks. However, we kept in the old code path for backwards compatibility. Now that the change is fully deployed, we can remove that old codepath.
Diffstat (limited to 'lib/gitlab/gitaly_client/repository_service.rb')
-rw-r--r--lib/gitlab/gitaly_client/repository_service.rb21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb
index a7e20d9429e..a08bfd0e25b 100644
--- a/lib/gitlab/gitaly_client/repository_service.rb
+++ b/lib/gitlab/gitaly_client/repository_service.rb
@@ -324,8 +324,8 @@ module Gitlab
GitalyClient.call(@storage, :repository_service, :search_files_by_name, request, timeout: GitalyClient.fast_timeout).flat_map(&:files)
end
- def search_files_by_content(ref, query, chunked_response: true)
- request = Gitaly::SearchFilesByContentRequest.new(repository: @gitaly_repo, ref: ref, query: query, chunked_response: chunked_response)
+ def search_files_by_content(ref, query)
+ request = Gitaly::SearchFilesByContentRequest.new(repository: @gitaly_repo, ref: ref, query: query)
response = GitalyClient.call(@storage, :repository_service, :search_files_by_content, request)
search_results_from_response(response)
@@ -340,18 +340,11 @@ module Gitlab
gitaly_response.each do |message|
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
-
- if message.end_of_match
- matches << current_match
- current_match = +""
- end
+ current_match << message.match_data
+
+ if message.end_of_match
+ matches << current_match
+ current_match = +""
end
end