Fix CI linter error when repository is empty

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)

Merge request reports

Loading