Error 500 when creating merge requests with submodule deletion
This appears to be a similar but different issue to #3893 (closed). When submodules are removed the diff fails to be generated with an error being thrown in submodule_link()
@clausa appears to have the same sort of error as well when renaming a submodule
Started GET "/FooTeam/FooProject/commit/76ed419adc0ee53198cec7b3b8a327ef560f3a7e" for 127.0.0.1 at 2015-12-15 12:00:48 +0000
Processing by Projects::CommitController#show as HTML
Parameters: {"namespace_id"=>"FooTeam", "project_id"=>"FooProject", "id"=>"76ed419adc0ee53198cec7b3b8a327ef560f3a7e"}
Completed 500 Internal Server Error in 555ms (ActiveRecord: 10.8ms)
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___2534097047021710941_60536320'
app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml___3790141050834119730_50882100'
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___3790141050834119730_50882100'
app/views/projects/commit/show.html.haml:5:in `_app_views_projects_commit_show_html_haml___4154109768477026444_64730040'
app/controllers/projects/commit_controller.rb:26:in `show'
--- a/some/foo/dir
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 9f9f65b1c26d9db41cef5ce080a1ce11dee432fa