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:
authorJasper Maes <jaspermaes.jm@gmail.com>2018-03-15 19:11:20 +0300
committerJasper Maes <jaspermaes.jm@gmail.com>2018-03-19 21:09:31 +0300
commitd17d3ec7f7d25af9091125bf6eac87ab1d30f938 (patch)
treefd7c7d094051599781aa0e4665c37ac8febad9f7 /lib/gitlab/project_search_results.rb
parent332a9bc85ac1ff10c9874d15c9f37d23e4600dbe (diff)
Split repository search result on \n instead of $ to prevent the items of the array to start with a newline. Remove the strip from parsing the search result to keep result endlines.
Diffstat (limited to 'lib/gitlab/project_search_results.rb')
-rw-r--r--lib/gitlab/project_search_results.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb
index 29277ec6481..390efda326a 100644
--- a/lib/gitlab/project_search_results.rb
+++ b/lib/gitlab/project_search_results.rb
@@ -58,7 +58,7 @@ module Gitlab
data = ""
startline = 0
- result.strip.each_line.each_with_index do |line, index|
+ result.each_line.each_with_index do |line, index|
prefix ||= line.match(/^(?<ref>[^:]*):(?<filename>.*)\x00(?<startline>\d+)\x00/)&.tap do |matches|
ref = matches[:ref]
filename = matches[:filename]