diff options
author | Andrew McCallum <andrew.mccallum@semafone.com> | 2018-01-15 10:05:46 +0000 |
---|---|---|
committer | Andrew McCallum <andrew.mccallum@semafone.com> | 2018-01-15 10:12:19 +0000 |
commit | e5afb44a9a1ef1f613f11e6bbb4134f30aaae655 (patch) | |
tree | 9cf4a884b6301f7539116090f7d467c00df3b612 /app/models/repository.rb | |
parent | f402762d2c315f462fb3c805990b9842953bc8dc (diff) | |
download | gitlab-ce-e5afb44a9a1ef1f613f11e6bbb4134f30aaae655.tar.gz |
Strip off leading slashes when searching in context of repository.
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 2ffd9558ebc..ab46872393b 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -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 |