diff options
Diffstat (limited to 'app/finders/git_refs_finder.rb')
-rw-r--r-- | app/finders/git_refs_finder.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/finders/git_refs_finder.rb b/app/finders/git_refs_finder.rb index 2289b34e562..11af659d37c 100644 --- a/app/finders/git_refs_finder.rb +++ b/app/finders/git_refs_finder.rb @@ -33,15 +33,21 @@ class GitRefsFinder end def filter_refs_with_prefix(refs, prefix) - refs.select { |ref| ref.name.upcase.starts_with?(prefix.upcase) } + prefix = prefix.downcase + + refs.select { |ref| ref.name.downcase.starts_with?(prefix) } end def filter_refs_with_suffix(refs, suffix) - refs.select { |ref| ref.name.upcase.ends_with?(suffix.upcase) } + suffix = suffix.downcase + + refs.select { |ref| ref.name.downcase.ends_with?(suffix) } end def filter_refs_by_name(refs, term) - refs.select { |ref| ref.name.upcase.include?(term.upcase) } + term = term.downcase + + refs.select { |ref| ref.name.downcase.include?(term) } end def set_exact_match_as_first_result(matches, term) |