diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-01 19:17:10 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-01 19:17:10 +0300 |
commit | d8258470b5c8cf5ec9f77cb1e0f8950a87b5c110 (patch) | |
tree | 689004c4eece5e63ebd3a2666898fe90fab1df92 /app | |
parent | 129dce999fdf7394e14bfb4a8bf858ede65d5801 (diff) | |
parent | a7d4824ded0c5ae6a155d7bdc87a1ba71eb3df5c (diff) |
Merge branch 'check-mergeability-in-merge-to-ref-service' into 'master'
Check mergeability in merge to ref service
See merge request gitlab-org/gitlab-ce!26757
Diffstat (limited to 'app')
-rw-r--r-- | app/models/merge_request.rb | 3 | ||||
-rw-r--r-- | app/services/merge_requests/merge_to_ref_service.rb | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index d3951cd72db..f6b83453c2a 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -807,8 +807,7 @@ class MergeRequest < ApplicationRecord end def mergeable_to_ref? - return false if merged? - return false if broken? + return false unless mergeable_state?(skip_ci_check: true, skip_discussions_check: true) # Given the `merge_ref_path` will have the same # state the `target_branch` would have. Ideally diff --git a/app/services/merge_requests/merge_to_ref_service.rb b/app/services/merge_requests/merge_to_ref_service.rb index 69cc441f1bb..87147d90c32 100644 --- a/app/services/merge_requests/merge_to_ref_service.rb +++ b/app/services/merge_requests/merge_to_ref_service.rb @@ -41,9 +41,7 @@ module MergeRequests super error = - if Feature.disabled?(:merge_to_tmp_merge_ref_path, project) - 'Feature is not enabled' - elsif !hooks_validation_pass?(merge_request) + if !hooks_validation_pass?(merge_request) hooks_validation_error(merge_request) elsif !@merge_request.mergeable_to_ref? "Merge request is not mergeable to #{target_ref}" |