Moving binary file to a directory with different encoding causes commit view to display Internal Server Error (500)
Created by: hmehta
Steps to reproduce:
- Get any binary-encoded file (i used: http://www.nda.nebraska.gov/avian/ai_public_fact_sheet.pdf)
- Add to index, commit
- mkdir directory structure with non-ASCII characters (i used: mkdir -p some/äöäöä/dir)
- git mv the PDF to the non-ASCII character directory structure
- Commit, push
- Attempt to view the commit in GitLab => Encoding error (500)
production.log:
Feb 21 08:56:17 emugit ruby[30618]: Started GET "/platform/specs/commit/157a500ca9647e6a66017be4fa9e2eacf4de2212" for 127.0.0.1 at 2014-02-21 08:56:17 +0000
Feb 21 08:56:17 emugit ruby[30618]: Processing by Projects::CommitController#show as HTML
Feb 21 08:56:17 emugit ruby[30618]: Parameters: {"project_id"=>"platform/specs", "id"=>"157a500ca9647e6a66017be4fa9e2eacf4de2212"}
Feb 21 08:56:17 emugit ruby[30618]: Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):
app/models/commit.rb:134:in method_missing' app/models/commit.rb:62:in
diff_suppress?'
app/controllers/projects/commit_controller.rb:18:in show' app/controllers/application_controller.rb:57:in
set_current_user_for_thread'
Feb 21 08:56:17 emugit ruby[30618]: Rendered errors/encoding.html.haml within layouts/errors (0.1ms)
Feb 21 08:56:17 emugit ruby[30618]: Rendered layouts/_head.html.haml (1.3ms)
Feb 21 08:56:17 emugit ruby[30618]: Rendered layouts/_search.html.haml (0.9ms)
Feb 21 08:56:17 emugit ruby[30618]: Rendered layouts/_head_panel.html.haml (7.4ms)
Feb 21 08:56:17 emugit ruby[30618]: Rendered layouts/_flash.html.haml (0.1ms)
Feb 21 08:56:17 emugit ruby[30618]: Completed 500 Internal Server Error in 455ms (Views: 15.5ms | ActiveRecord: 10.8ms)