• Bob Van Landuyt's avatar
    Validate the diff head sha when merging · 7d10d4aa
    Bob Van Landuyt authored
    This compares the `MergeRequest#diff_head_sha` before squashing or
    merging to a sha passed by the caller. If the `diff_head_sha` changed,
    this means that the branch was updated since the merge was scheduled.
    
    The `diff_head_sha` is the one passed to gitaly for merging or
    squashing. So validating it right before performing the merge rather
    than only in the controller would prevent the
    `MergeRequests::RefreshService` from changing it between scheduling
    the merge and actually merging.
    7d10d4aa
process_commit_worker_spec.rb 4.93 KB