`Repository#merge` should be wrapped in a transaction
The second call to the Gitaly UserMergeBranch
RPC method can raise an exception. Currently, if this were to happen, the merge request's in_progress_merge_commit_sha
attribute would be set to a commit SHA that doesn't exist. Repository#merge
should use a transaction block in order to rollback the setting of this attribute if any error occurs.
Edited by Luke Duncalfe