Check immeditately mergeable correctly
What does this MR do and why?
Fixes the auto-merge API endpoint to correctly check merge request mergeability, aligning API behavior with the UI.
How to test
- Create a merge request with
merge_afterset to a future time - Wait for pipeline to succeed
- Use the API to set
auto_merge:PUT /projects/:id/merge_requests/:iid/merge?auto_merge=true - Before: Request fails with "Branch cannot be merged"
- After: Request succeeds and sets auto-merge
Related Issue: #547151
Edited by Marc Shaw