NoMethodError when viewing commit contents
This worked in 0.8 but when trying to view commit contents in 0.12.0rc3:
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/username/test/commit/f115ef2252d976f396749c3a85cb3ccc08975e57" for 93.205.209.41 at 2020-03-23 16:16:39 +0000
Processing by Projects::CommitController#show as HTML
Parameters: {"namespace_id"=>"username", "project_id"=>"test", "id"=>"f115ef2252d976f396749c3a85cb3ccc08975e57"}
Completed 500 Internal Server Error in 145ms (ActiveRecord: 28.4ms)
NoMethodError (undefined method `first' for nil:NilClass):
lib/gitlab/git/commit.rb:262:in `parent_hgid'
app/models/commit.rb:282:in `method_missing'
app/models/commit.rb:297:in `diff_refs'
lib/gitlab/diff/file_collection/commit.rb:11:in `initialize'
app/models/commit.rb:443:in `new'
app/models/commit.rb:443:in `diffs'
app/controllers/projects/commit_controller.rb:150:in `define_commit_vars'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:461:in `set_session_storage'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:455:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:26:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
```
/label ~Bug
Edited by vomout