summaryrefslogtreecommitdiff
path: root/lib/api/files.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-08-04 19:18:07 +0200
committerDouwe Maan <douwe@selenight.nl>2017-08-04 19:18:07 +0200
commitd41479266d16facdce08974ef76f3fb7539a1530 (patch)
treeb41245c96a85968bde0a65d66328aecbd99031c0 /lib/api/files.rb
parentc41f64d7ff8ddcc47e0ab269accc33b4a2653a22 (diff)
downloadgitlab-ce-d41479266d16facdce08974ef76f3fb7539a1530.tar.gz
Add start_branch to files and commits APIs
Diffstat (limited to 'lib/api/files.rb')
-rw-r--r--lib/api/files.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb
index 521287ee2b4..450334fee84 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -4,7 +4,7 @@ module API
def commit_params(attrs)
{
file_path: attrs[:file_path],
- start_branch: attrs[:branch],
+ start_branch: attrs[:start_branch] || attrs[:branch],
branch_name: attrs[:branch],
commit_message: attrs[:commit_message],
file_content: attrs[:content],
@@ -37,8 +37,9 @@ module API
params :simple_file_params do
requires :file_path, type: String, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb'
- requires :branch, type: String, desc: 'The name of branch'
- requires :commit_message, type: String, desc: 'Commit Message'
+ 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'
+ optional :start_branch, type: String, desc: 'Name of the branch to start the new commit from'
optional :author_email, type: String, desc: 'The email of the author'
optional :author_name, type: String, desc: 'The name of the author'
end