Submodule update breaks diff functionality

Created by: codec

Merge requests (for example) with a commit that includes change of a submodule breaks the diff view.

ActionView::Template::Error (undefined method `text?' for #<Grit::Submodule "7abc3fc208c44c489d05a9b8e974a8375ac850f4">):
    15:           %strong{:id => "#{diff.b_path}"}= diff.b_path
    16:       %br/
    17:     .diff_file_content
    18:       - if file.text?
    19:         = render "commits/text_file", :diff => diff, :index => i
    20:       - elsif file.image?
    21:         .diff_file_content_image
  app/views/commits/_diffs.html.haml:18:in `block in _app_views_commits__diffs_html_haml___804080178914469005_24703560'
  app/views/commits/_diffs.html.haml:4:in `each'
  app/views/commits/_diffs.html.haml:4:in `each_with_index'
  app/views/commits/_diffs.html.haml:4:in `_app_views_commits__diffs_html_haml___804080178914469005_24703560'
  app/views/commits/compare.html.haml:32:in `_app_views_commits_compare_html_haml__3475857172488992646_46231900'

The diff in rails console

irb(main):013:0> MergeRequest.find(10).diffs.last.diff
  MergeRequest Load (0.6ms)  SELECT "merge_requests".* FROM "merge_requests" WHERE "merge_requests"."id" = ? LIMIT 1  [["id", 10]]
=> "--- a/public/scripts/fileuploader\n+++ b/public/scripts/fileuploader\n@@ -1 +1 @@\n-Subproject commit b3b20b156d6c2dde2881a8667e6ad859a076e1c3\n+Subproject commit dc8da17e0c95999fdffacca962a0d31c5590280c"