NoMethodError: undefined method `exists?' for []:Array

https://sentry.gitlab.net/gitlab/gitlabcom/issues/561521/

NoMethodError: undefined method `exists?' for []:Array
  merge_request.rb:361:in `includes_any_commits?'
    merge_request_diff.commits_by_shas(shas).exists?
  gitlab/metrics/instrumentation.rb:159:in `block in includes_any_commits?'
    .measure { super }
  gitlab/metrics/method_call.rb:34:in `measure'
    retval = yield
  gitlab/metrics/instrumentation.rb:159:in `includes_any_commits?'
    .measure { super }
  merge_requests/refresh_service.rb:90:in `block in reload_merge_requests'
    elsif merge_request.includes_any_commits?(push_commit_ids)
...
(54 additional frame(s) were not displayed)

undefined method `exists?' for []:Array