Skip to content
Snippets Groups Projects
Commit d7bcfe4f authored by Dirceu Pereira Tiegs's avatar Dirceu Pereira Tiegs
Browse files

Fix issue #3055 (project search with unmatched parentheses)

parent 976400c1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -482,7 +482,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