Create rebased ref and fast-forward to merge

  • Given that the option to rebase and merge defined in Implement Rebase and Merge with One Click check... (#519379) is enabled
  • When checking if a merge request can be merged, relax the requirement that ff_merge_possible? and check if the source branch can be rebased instead
  • When merging (auto-merge or otherwise)
    • Create a scoped ref that points to the source branch rebased on the target branch (consider using MergeRequests::CreateRefService)
    • fast-forward merge the scoped ref into the target branch
  • Human readable errors should be raised so that they can be persisted on the merge_requests.merge_error if they occur in the process
  • Consider rolling out behind a feature flag
Edited by Jerry Seto