Skip to content

Fix CI linter error when repository is empty

Grzegorz Bizon requested to merge fix/gb/fix-ci-linter-error into master

What does this MR do and why?

NoMethodError: undefined method `sha' for nil:NilClass

    @root_ref_sha ||= head_commit.sha
                                 ^^^^
  from app/models/repository.rb:982:in `root_ref_sha'
  from lib/api/lint.rb:28:in `block (2 levels) in <class:Lint>'
  from grape (2.0.0) lib/grape/endpoint.rb:58:in `call'

See CI Lint raises NoMethodError (#440390 - closed)

Edited by Grzegorz Bizon

Merge request reports