diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-05-15 10:20:18 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-15 10:20:18 +0000 |
commit | 91f8656c2c30fe2a31ead5f9f3d4efd56b4980ac (patch) | |
tree | 95125f7ac52783eb59288d014b7d15ee29093eb4 /lib/gitlab/project_search_results.rb | |
parent | a78b1b27b86d34c00e1b0631e967d637f8a6714b (diff) | |
download | gitlab-ce-91f8656c2c30fe2a31ead5f9f3d4efd56b4980ac.tar.gz |
Disable greedy mode when matching filename
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 390efda326a..2e9b6e302f5 100644 --- a/lib/gitlab/project_search_results.rb +++ b/lib/gitlab/project_search_results.rb @@ -59,7 +59,7 @@ module Gitlab startline = 0 result.each_line.each_with_index do |line, index| - prefix ||= line.match(/^(?<ref>[^:]*):(?<filename>.*)\x00(?<startline>\d+)\x00/)&.tap do |matches| + prefix ||= line.match(/^(?<ref>[^:]*):(?<filename>[^\x00]*)\x00(?<startline>\d+)\x00/)&.tap do |matches| ref = matches[:ref] filename = matches[:filename] startline = matches[:startline] |