diff options
Diffstat (limited to 'app/services/merge_requests/refresh_service.rb')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index d6740cdf1ac..3a5e8d09759 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -169,7 +169,15 @@ module MergeRequests @outdate_service ||= Suggestions::OutdateService.new end + def abort_auto_merges?(merge_request) + return true unless Feature.enabled?(:fix_interrupted_mwps, @project) + + merge_request.merge_params.with_indifferent_access[:sha] != @push.newrev + end + def abort_auto_merges(merge_request) + return unless abort_auto_merges?(merge_request) + abort_auto_merge(merge_request, 'source branch was updated') end |