Error on submodule update commit
The below error occurs from a commit view. (e.g. http://.../commit/2340ade4f9c55a954e18f111974e842156329b47
)
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
11: = view_file_btn(@commit.parent_id, diff_file, project)
12: - elsif diff_file.diff.submodule?
13: - submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path)
14: = submodule_link(submodule_item, @commit.id)
15: - else
16: - if diff_file.renamed_file
17: %span= "#{diff_file.old_path} renamed to #{diff_file.new_path}"
app/models/repository.rb:170:in `method_missing'
app/models/repository.rb:232:in `submodule_url_for'
app/helpers/submodule_helper.rb:6:in `submodule_links'
app/helpers/diff_helper.rb:140:in `submodule_link'
app/views/projects/diffs/_file.html.haml:14:in `_app_views_projects_diffs__file_html_haml__727675300908585537_20923820'
app/views/projects/diffs/_diffs.html.haml:14:in `block in _app_views_projects_diffs__diffs_html_haml___1550302330890340437_4553340'
app/views/projects/diffs/_diffs.html.haml:13:in `each'
app/views/projects/diffs/_diffs.html.haml:13:in `each_with_index'
app/views/projects/diffs/_diffs.html.haml:13:in `_app_views_projects_diffs__diffs_html_haml___1550302330890340437_4553340'
app/views/projects/commit/show.html.haml:2:in `_app_views_projects_commit_show_html_haml___924426543096852268_109439480'
app/controllers/projects/commit_controller.rb:25:in `show'
My .gitmodules
looks like:
[submodule "lib/foo.git"]
path = lib/foo.git
url = http://10.10.10.10/xxx/foo.git
[submodule "lib/bar.git"]
path = lib/bar.git
url = http://10.10.10.10/xxx/bar.git
[submodule "test/baz.git"]
path = test/baz.git
url = http://10.10.10.10/xxx/baz.git
The commit includes 2 submodule updates:
$ git show 2340ade
...
diff --git a/lib/foo.git b/lib/foo.git
index 14c6328..912d107 160000
--- a/lib/foo.git
+++ b/lib/foo.git
@@ -1 +1 @@
-Subproject commit 14c632891ebdb330b60ec30e42f766e4970aab43
+Subproject commit 912d10790f7a33942333f495757cf37dddaab53a
diff --git a/lib/bar.git b/lib/bar.git
index b387ae4..072bae5 160000
--- a/lib/bar.git
+++ b/lib/bar.git
@@ -1 +1 @@
-Subproject commit b387ae434ea54c0a917d6333668d630ef8beb69d
+Subproject commit 072bae5aadaddb4d4fe7562862435ca4cc8734d9
I'm using GitLab 7.9.2. It was installed by Omnibus GitLab.