gitaly: Handle newly introduced ReferenceUpdateErrors
When updating references in UserMergeBranch failed due to a concurrent update of the same reference, then Gitaly used to return no error at all but instead just return an empty gRPC response. This behaviour isn't obvious at all and easy to get wrong. Furthermore, Rails didn't have any information about what went wrong. To fix this, Gitaly has introduced a new error type which is returned in case there was a race updating the reference. Instead of returning successful, it now returns an error with a ReferenceUpdateError embedded inside of it. This allow us to extract this error and thus know exactly what happened, including the reference that failed to update with both its old and new expected object ID values. Update the Gitaly client to handle this error in a backwards-compatible fashion. For now this means that we silently ignore it like we used to do with the old error as well.
Showing
Please register or sign in to comment