提交 e5afb44a 编写于 作者: A Andrew McCallum

Strip off leading slashes when searching in context of repository.

上级 f402762d
......@@ -940,7 +940,7 @@ 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)})
args = %W(ls-tree --full-tree -r #{ref || root_ref} --name-status | #{Regexp.escape(query.sub(/^\/*/,""))})
run_git(args).first.lines.map(&:strip)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册