Skip to content

[Port] Treat empty or invalid commit SHAs at UserMergeToRef RPC

What does this MR do?

It's possible that Gitaly sends an empty SHA when merging to ref.

It happens given at Gitaly we rescue a Gitlab::Git::CommitError (which happens when conflicting). Given the way ProtoBuffer works, it converts the response into an empty string, given it's defined as a string parameter.

It solves a low rate error https://sentry.gitlab.net/gitlab/gitlabcom/issues/844104/?query=is:unresolved%20MergeRequestsController#show.

I was able to reproduce it by forcing a Gitlab::Git::CommitError at Gitaly.

Does this MR meet the acceptance criteria?

Conformity

Merge request reports