diff options
author | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-03-15 19:11:20 +0300 |
---|---|---|
committer | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-03-19 21:09:31 +0300 |
commit | d17d3ec7f7d25af9091125bf6eac87ab1d30f938 (patch) | |
tree | fd7c7d094051599781aa0e4665c37ac8febad9f7 /lib/gitlab/project_search_results.rb | |
parent | 332a9bc85ac1ff10c9874d15c9f37d23e4600dbe (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.rb | 2 |
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] |