Refactor root sha access code
What does this MR do and why?
Contributes to #391900 (closed)
Sentry error: https://new-sentry.gitlab.net/organizations/gitlab/issues/1619/?project=3
Problem
We raise, handle an exception and report an error to Sentry without a reason. It can be done outside of exception handling flow.
Solution
Verify if the root commit exists before requesting its sha.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin