Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-08-04 20:18:07 +0300
committerDouwe Maan <douwe@selenight.nl>2017-08-04 20:18:07 +0300
commitd41479266d16facdce08974ef76f3fb7539a1530 (patch)
treeb41245c96a85968bde0a65d66328aecbd99031c0 /lib/api/commits.rb
parentc41f64d7ff8ddcc47e0ab269accc33b4a2653a22 (diff)
Add start_branch to files and commits APIs
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r--lib/api/commits.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb
index bcb842b9211..bc9f5d93ec1 100644
--- a/lib/api/commits.rb
+++ b/lib/api/commits.rb
@@ -53,16 +53,18 @@ module API
detail 'This feature was introduced in GitLab 8.13'
end
params do
- requires :branch, type: String, desc: 'The name of branch'
+ requires :branch, type: String, desc: 'Name of the branch to commit into. To create a new branch, also provide `start_branch`.'
requires :commit_message, type: String, desc: 'Commit message'
requires :actions, type: Array[Hash], desc: 'Actions to perform in commit'
+ optional :start_branch, type: String, desc: 'Name of the branch to start the new commit from'
optional :author_email, type: String, desc: 'Author email for commit'
optional :author_name, type: String, desc: 'Author name for commit'
end
post ":id/repository/commits" do
authorize! :push_code, user_project
- attrs = declared_params.merge(start_branch: declared_params[:branch], branch_name: declared_params[:branch])
+ attrs[:branch_name] = declared_params.delete(:branch)
+ attrs[:start_branch] ||= attrs[:branch_name]
result = ::Files::MultiService.new(user_project, current_user, attrs).execute