diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-11-20 14:04:51 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-11-20 14:04:51 +0300 |
commit | 5cd0e7d29ff4c9fbe3a542212e6823b741abcac9 (patch) | |
tree | a8fbf3d796e48b9eaf25309839b11c923bf5b548 /app/services/merge_requests | |
parent | e65e184269bb27661c9a20658933e8482aa90b62 (diff) | |
parent | 6b0ea951cac3905437abb2bbacaf422371f097e0 (diff) |
Merge branch '40085-add-a-create_merge_request-quick-action' into 'master'
Resolve "Add a `/create_merge_request` quick action"
Closes #40085
See merge request gitlab-org/gitlab-ce!22485
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r-- | app/services/merge_requests/create_from_issue_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/merge_requests/create_from_issue_service.rb b/app/services/merge_requests/create_from_issue_service.rb index 020af0bb950..e69791872cc 100644 --- a/app/services/merge_requests/create_from_issue_service.rb +++ b/app/services/merge_requests/create_from_issue_service.rb @@ -19,13 +19,15 @@ module MergeRequests result = CreateBranchService.new(project, current_user).execute(branch_name, ref) return result if result[:status] == :error - SystemNoteService.new_issue_branch(issue, project, current_user, branch_name) - new_merge_request = create(merge_request) if new_merge_request.valid? + SystemNoteService.new_merge_request(issue, project, current_user, new_merge_request) + success(new_merge_request) else + SystemNoteService.new_issue_branch(issue, project, current_user, branch_name) + error(new_merge_request.errors) end end |