Viewing files fails with 500 error for forked project having relative submodule URLs
GitLab chokes and produces a 500 error when trying to view the Files tab for a project that has been forked from another namespace which has submodules with relative URLs.
Started GET "/cbennett/dgx_mcpu/tree/master" for 127.0.0.1 at 2014-11-06 15:44:43 -0800
Processing by Projects::TreeController#show as HTML
Parameters: {"project_id"=>"cbennett/dgx_mcpu", "id"=>"master"}
Completed 500 Internal Server Error in 106ms
ActionView::Template::Error (undefined method `path' for nil:NilClass):
1: - tree, commit = submodule_links(submodule_item)
2: %tr{ class: "tree-item" }
3: %td.tree-item-file-name
4: %i.fa.fa-archive
app/helpers/submodule_helper.rb:55:in `relative_self_links'
app/helpers/submodule_helper.rb:16:in `submodule_links'
app/views/projects/tree/_submodule_item.html.haml:1:in `_app_views_projects_tree__submodule_item_html_haml__2558977959077422879_32576700'
app/helpers/tree_helper.rb:19:in `render_tree'
app/views/projects/tree/_tree.html.haml:42:in `_app_views_projects_tree__tree_html_haml___2173234514704223664_8308820'
app/views/projects/tree/show.html.haml:9:in `_app_views_projects_tree_show_html_haml___3797058798207667896_14636340'
app/controllers/projects/tree_controller.rb:13:in `show'
The submodules of the project we are trying to view have also been forked into the user's own namespace, so the relative URLs (e.g. url = ../subproj.git
) should continue to work.
This is GitLab 7.4.3 Omnibus.