Skip to content
Snippets Groups Projects
Commit 7ce732fb authored by Andrew McCallum's avatar Andrew McCallum
Browse files

Create intermediary variable for query value with leading slashes removed.

parent bce6a891
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -940,7 +940,9 @@ class Repository
def search_files_by_name(query, ref)
return [] if empty? || query.blank?
 
args = %W(ls-tree --full-tree -r #{ref || root_ref} --name-status | #{Regexp.escape(query.sub(/^\/*/, ""))})
safe_query = query.sub(/^\/*/, "")
args = %W(ls-tree --full-tree -r #{ref || root_ref} --name-status | #{Regexp.escape(safe_query)})
 
run_git(args).first.lines.map(&:strip)
end
Loading
Loading
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