Error 500 on commit view if a parent is obsolete
Here is the error:
ActionView::Template::Error (undefined method `hpd_short_display_id' for nil:NilClass):
35: = custom_icon("icon_commit")
36: %span.cgray= n_('parent', 'parents', @commit.parents.count)
37: - @commit.parents.each do |parent|
38: = link_to parent.hpd_short_display_id, project_commit_path(@project, parent), class: "commit-sha"
39: .commit-info.branches
40: .gl-spinner.vertical-align-middle
41:
It turns out that the parents are fetched from (H)Gitaly using the ListCommitsByOid
gRPC method, which does not work on obsolete changesets, whereas the main commit is fetched with FindCommit
, which does work on obsolete changesets, if requested by full node id.