dc78ee4e8b
Ignore binary files in code search to prevent Error 500 Leaving out the -I option in "git grep" would cause an Error 500 because the resulting line would include "Binary file X matches", which would cause the project search results to crash with the following error: ``` 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:742:in `sub' app/models/repository.rb:742:in `block in parse_search_result_from_grep' app/models/repository.rb:741:in `each_line' app/models/repository.rb:741:in `parse_search_result_from_grep' app/models/repository.rb:682:in `parse_search_result' app/views/search/results/_blob.html.haml:1:in `_app_views_search_results__blob_html_haml__1959871337755590783_162450160' app/views/search/_results.html.haml:20:in `_app_views_search__results_html_haml__2198486911700532411_58329920' app/views/search/show.html.haml:7:in `_app_views_search_show_html_haml___1698304427272645201_62235300' ``` See merge request !2565 |
||
---|---|---|
.. | ||
ci | ||
concerns | ||
hooks | ||
members | ||
network | ||
project_services | ||
.gitkeep | ||
ability.rb | ||
abuse_report.rb | ||
application_setting.rb | ||
audit_event.rb | ||
broadcast_message.rb | ||
commit.rb | ||
commit_range.rb | ||
commit_status.rb | ||
deploy_key.rb | ||
deploy_keys_project.rb | ||
diff_line.rb | ||
email.rb | ||
event.rb | ||
external_issue.rb | ||
forked_project_link.rb | ||
generic_commit_status.rb | ||
global_label.rb | ||
global_milestone.rb | ||
group.rb | ||
identity.rb | ||
issue.rb | ||
jira_issue.rb | ||
key.rb | ||
label.rb | ||
label_link.rb | ||
lfs_object.rb | ||
lfs_objects_project.rb | ||
member.rb | ||
merge_request.rb | ||
merge_request_diff.rb | ||
milestone.rb | ||
namespace.rb | ||
note.rb | ||
notification.rb | ||
personal_snippet.rb | ||
project.rb | ||
project_import_data.rb | ||
project_snippet.rb | ||
project_team.rb | ||
project_wiki.rb | ||
protected_branch.rb | ||
release.rb | ||
repository.rb | ||
security_event.rb | ||
sent_notification.rb | ||
service.rb | ||
snippet.rb | ||
subscription.rb | ||
tree.rb | ||
user.rb | ||
users_star_project.rb | ||
wiki_page.rb |