diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-05 15:33:37 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-05 15:33:37 +0300 |
commit | 0561e6317d843ec0dc5b93f57b1ec702b20654ae (patch) | |
tree | 6d9b5519400e903e35777699786a2027e4d36fc2 /app/services | |
parent | 2fc29237aacd8df778ede532e450d06c79c63004 (diff) | |
parent | a39d6d896f6a83176c67c6ebc965ce76eab5249c (diff) |
Merge remote-tracking branch 'origin/master' into list-multiple-clusters
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/build_service.rb | 8 | ||||
-rw-r--r-- | app/services/merge_requests/create_service.rb | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb index c2fb01466df..9622a5c5462 100644 --- a/app/services/merge_requests/build_service.rb +++ b/app/services/merge_requests/build_service.rb @@ -10,8 +10,12 @@ module MergeRequests merge_request.target_branch = find_target_branch merge_request.can_be_created = branches_valid? - compare_branches if branches_present? - assign_title_and_description if merge_request.can_be_created + # compare branches only if branches are valid, otherwise + # compare_branches may raise an error + if merge_request.can_be_created + compare_branches + assign_title_and_description + end merge_request end diff --git a/app/services/merge_requests/create_service.rb b/app/services/merge_requests/create_service.rb index 820709583fa..49cf534dc0d 100644 --- a/app/services/merge_requests/create_service.rb +++ b/app/services/merge_requests/create_service.rb @@ -35,6 +35,12 @@ module MergeRequests super end + # expose issuable create method so it can be called from email + # handler CreateMergeRequestHandler + def create(merge_request) + super + end + private def update_merge_requests_head_pipeline(merge_request) |