Create merge refs for MRs (merge and squash methods)
refs/merge-requests/$iid/head for checking out the HEAD of a merge request. We could also provide a corresponding
refs/merge-requests/$iid/merge for the merge result of the merge.
We already calculate this when someone loads an unchecked merge request to see if there are conflicts. Instead of throwing that away, we could write the result to the ref. This would allow CI services to checkout and test the result of the merge request rather than the just the
HEAD of the feature branch which may not be accurate.
- when the merge result is calculated write the result to
- add API method to manually trigger calculation of the merge ref
Challenges: the merge ref will only be valid for the HEAD of the target branch when the merge commit is generated. If the HEAD of the target branch changes the merge ref will not be automatically updated.
Ideally, we would use this ref for merging, but we'd need to make sure that we can atomically update the ref (if needed) and then merge. This is out of scope
- gitaly!1057 (merged)