Skip to content
Snippets Groups Projects
Commit b6f8d010 authored by Douwe Maan's avatar Douwe Maan
Browse files

Merge branch 'dirceu/gitlab-ce-fix-project-search-with-unmatched-parentheses'

parents 9b937046 d7bcfe4f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -496,7 +496,7 @@ class Repository
 
def search_files(query, ref)
offset = 2
args = %W(git grep -i -n --before-context #{offset} --after-context #{offset} #{query} #{ref || root_ref})
args = %W(git grep -i -n --before-context #{offset} --after-context #{offset} -e #{query} #{ref || root_ref})
Gitlab::Popen.popen(args, path_to_repo).first.scrub.split(/^--$/)
end
 
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ module Gitlab
else
nil
end
@query = Shellwords.shellescape(query) if query.present?
@query = query
end
 
def objects(scope, page = nil)
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe Gitlab::ProjectSearchResults do
 
it { expect(results.project).to eq(project) }
it { expect(results.repository_ref).to be_nil }
it { expect(results.query).to eq('hello\\ world') }
it { expect(results.query).to eq('hello world') }
end
 
describe 'initialize with ref' do
Loading
Loading
@@ -18,6 +18,6 @@ describe Gitlab::ProjectSearchResults do
 
it { expect(results.project).to eq(project) }
it { expect(results.repository_ref).to eq(ref) }
it { expect(results.query).to eq('hello\\ world') }
it { expect(results.query).to eq('hello world') }
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment