Searching in project results in error 500
Hi, we ran into issue when searching for string such as "fa" or "favicon" in project (other strings such as fa2 or favicontest work without problems). Searching in all other pages (activity etc.) works without any problems too.
Gitlab is running on latest Debian Jessie with nginx and postgress 9.4, gitlab is installed from official gitlab repository (lastest version 8.8.4)
Here are relevant logs from production.log
Started GET "/search?utf8=%E2%9C%93&snippets=&scope=projects&search=favicon&project_id=52" for IP at 2016-06-14 10:32:58 +0200
Processing by SearchController#show as HTML
Parameters: {"utf8"=>"✓", "snippets"=>"", "scope"=>"projects", "search"=>"favicon", "project_id"=>"52"}
Completed 500 Internal Server Error in 261ms (ActiveRecord: 11.8ms)
ActionView::Template::Error (premature end of char-class: /.log-1-[Tue May 31 12$/):
1: - blob = @project.repository.parse_search_result(blob)
2: .blob-result
3: .file-holder
4: .file-title
app/models/repository.rb:880:in `block in parse_search_result'
app/models/repository.rb:875:in `each_line'
app/models/repository.rb:875:in `each_with_index'
app/models/repository.rb:875:in `parse_search_result'
app/views/search/results/_blob.html.haml:1:in `_app_views_search_results__blob_html_haml__4077667862105688757_65490960'
app/views/search/_results.html.haml:18:in `_app_views_search__results_html_haml___3350298589791260586_65287640'
app/views/search/show.html.haml:7:in `_app_views_search_show_html_haml___2507909675999318616_62851980'
lib/gitlab/middleware/go.rb:16:in `call'
Started GET "/search?utf8=%E2%9C%93&project_id=52&group_id=&snippets=&scope=&search=favicon)" for IP at 2016-06-14 10:32:01 +0200
Processing by SearchController#show as HTML
Parameters: {"utf8"=>"✓", "project_id"=>"52", "group_id"=>"", "snippets"=>"", "scope"=>"", "search"=>"favicon)"}
Completed 500 Internal Server Error in 211ms (ActiveRecord: 12.9ms)
ActionView::Template::Error (wrong argument type nil (expected Regexp)):
1: - blob = @project.repository.parse_search_result(blob)
2: .blob-result
3: .file-holder
4: .file-title
app/models/repository.rb:888:in `sub'
app/models/repository.rb:888:in `block in parse_search_result'
app/models/repository.rb:887:in `each_line'
app/models/repository.rb:887:in `parse_search_result'
app/views/search/results/_blob.html.haml:1:in `_app_views_search_results__blob_html_haml__4077667862105688757_65490960'
app/views/search/_results.html.haml:18:in `_app_views_search__results_html_haml___3350298589791260586_65287640'
app/views/search/show.html.haml:7:in `_app_views_search_show_html_haml___2507909675999318616_62851980'
lib/gitlab/middleware/go.rb:16:in `call'