Error when viewing diff of a commit that removes a submodule
I've been able to reproduce it with this repository. Error as it appears in the log:
Started GET "/root/gitlab-bug-test/commit/e66073b6d15af2d2813ccd6585e18668c332d209" for 127.0.0.1 at 2015-12-09 09:27:53 +0100
Processing by Projects::CommitController#show as HTML
Parameters: {"namespace_id"=>"root", "project_id"=>"gitlab-bug-test", "id"=>"e66073b6d15af2d2813ccd6585e18668c332d209"}
Completed 500 Internal Server Error in 494ms (ActiveRecord: 28.7ms)
ActionView::Template::Error (undefined method `path' for nil:NilClass):
3: - if diff_file.diff.submodule?
4: %span
5: - submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path)
6: = submodule_link(submodule_item, @commit.id, project.repository)
7: - else
8: %span
9: - if diff_file.deleted_file
app/helpers/submodule_helper.rb:6:in `submodule_links'
app/helpers/diff_helper.rb:161:in `submodule_link'
app/views/projects/diffs/_file.html.haml:6:in `_app_views_projects_diffs__file_html_haml__2744709491749725642_60013120'
app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml___3779075093001523260_60946760'
app/views/projects/diffs/_diffs.html.haml:17:in `each'
app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index'
app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml___3779075093001523260_60946760'
app/views/projects/commit/show.html.haml:5:in `_app_views_projects_commit_show_html_haml__3641382268752044921_67634040'
app/controllers/projects/commit_controller.rb:26:in `show'