diff options
author | Christian Couder <chriscool@tuxfamily.org> | 2019-07-16 10:16:41 +0300 |
---|---|---|
committer | Christian Couder <chriscool@tuxfamily.org> | 2019-07-24 12:04:49 +0300 |
commit | 7cf4bf848f9d3018af2c87d7c88b26b7610db995 (patch) | |
tree | 064700fc164515f518ca6c03b73b229cfcbcc4da /app/services | |
parent | b2e4a7957ab7ae8e4ed5ae1fd4c0f3f826f26777 (diff) |
Support title and desc on merge w/ push option
MergeRequests::PushOptionsHandlerService has been updated to allow
creating and updating merge requests with the `title` and
`description` set using git push options.
To create a new merge request and set its title and description:
git push -u origin -o merge_request.create \
-o merge_request.title="My title" \
-o merge_request.description="My description"
To update an existing merge request and set its title and
description:
git push -u origin -o merge_request.title="My title" \
-o merge_request.description="My description"
Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/64320
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/push_options_handler_service.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/services/merge_requests/push_options_handler_service.rb b/app/services/merge_requests/push_options_handler_service.rb index 6d70b5106c7..b210004e6e1 100644 --- a/app/services/merge_requests/push_options_handler_service.rb +++ b/app/services/merge_requests/push_options_handler_service.rb @@ -118,7 +118,14 @@ module MergeRequests end def base_params - params = {} + params = { + title: push_options[:title], + description: push_options[:description], + target_branch: push_options[:target], + force_remove_source_branch: push_options[:remove_source_branch] + } + + params.compact! if push_options.key?(:merge_when_pipeline_succeeds) params.merge!( @@ -127,14 +134,6 @@ module MergeRequests ) end - if push_options.key?(:remove_source_branch) - params[:force_remove_source_branch] = push_options[:remove_source_branch] - end - - if push_options.key?(:target) - params[:target_branch] = push_options[:target] - end - params end |