Gracefully handle case when repository's root ref does not exist

This was failing regularly with an Error 500 when the API branches endpoint was used.

Closes #40615 (closed)

Merge request reports

Loading