ui can't handle files with bad utf-8 in filename
Summary
Locally, in gitlab-ce, when I add a commit on master with bad utf-8 characters in filenames, I get an exception.
On gitlab.com, the project simply appears to be empty.
Steps to reproduce
Clone this repository: https://gitlab.com/dturner_ts/test-utf8
Notice that it appears to be empty in the UI (oh, wait, now I get a 500 error when I reload it!), but when you clone it, you find that it has one commit, adding three files. Now push the commit to a gitlab project. Locally, I get:
Completed 500 Internal Server Error in 195ms (ActiveRecord: 17.3ms)
ArgumentError - invalid byte sequence in UTF-8:
lib/gitlab/file_detector.rb:70:in `block in type_of'
lib/gitlab/file_detector.rb:68:in `type_of'
app/models/repository.rb:1072:in `block in file_on_head'
app/models/repository.rb:1071:in `file_on_head'
app/models/repository.rb:513:in `avatar'
app/models/repository.rb:51:in `block (2 levels) in cache_method'
activesupport (4.2.8) lib/active_support/cache.rb:299:in `block in fetch'
activesupport (4.2.8) lib/active_support/cache.rb:585:in `block in save_block_result_to_cache'
activesupport (4.2.8) lib/active_support/cache.rb:547:in `block in instrument'
activesupport (4.2.8) lib/active_support/notifications.rb:166:in `instrument'
activesupport (4.2.8) lib/active_support/cache.rb:547:in `instrument'
activesupport (4.2.8) lib/active_support/cache.rb:584:in `save_block_result_to_cache'
activesupport (4.2.8) lib/active_support/cache.rb:299:in `fetch'
lib/repository_cache.rb:20:in `fetch'
app/models/repository.rb:1054:in `cache_method_output'
app/models/repository.rb:51:in `block in cache_method'
app/models/project.rb:848:in `avatar_in_git'
app/models/project.rb:854:in `avatar_url'
app/helpers/application_helper.rb:43:in `project_icon'
app/views/projects/_home_panel.html.haml:5:in `_app_views_projects__home_panel_html_haml__3300779538737981085_47416489580980'
actionview (4.2.8) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.8) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.8) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.8) lib/action_view/template.rb:143:in `render'
actionview (4.2.8) lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
actionview (4.2.8) lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
actionview (4.2.8) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
activesupport (4.2.8) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.8) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.8) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
actionview (4.2.8) lib/action_view/renderer/partial_renderer.rb:309:in `render'
actionview (4.2.8) lib/action_view/renderer/renderer.rb:51:in `render_partial'
actionview (4.2.8) lib/action_view/helpers/rendering_helper.rb:35:in `render'
haml (4.0.7) lib/haml/helpers/action_view_mods.rb:12:in `render_with_haml'
app/views/projects/show.html.haml:13:in `_app_views_projects_show_html_haml___3843608372389083532_47416481705720'
actionview (4.2.8) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.8) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.8) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.8) lib/action_view/template.rb:143:in `render'
actionview (4.2.8) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
actionview (4.2.8) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
Example Project
https://gitlab.com/dturner_ts/test-utf8
What is the current bug behavior?
Repository contents not displayed, or exception
What is the expected correct behavior?
The repository contents ought to be displayed in some fashion which makes it clear what is going on.