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:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-02-02 17:24:30 +0300
committerOswaldo Ferreira <oswluizf@gmail.com>2017-02-21 22:33:14 +0300
commitc79bbe26ab1e16facddaf159d4d074937586d742 (patch)
tree8b62ca587ac78806aa59fd53fba67e375e84fca6 /lib/api/commits.rb
parent51546e26d7aa904a69090004de57d03dbe7268d7 (diff)
Change branch_name param to branch throughout V4 API
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r--lib/api/commits.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb
index 3b314c89c6e..0cd817f9352 100644
--- a/lib/api/commits.rb
+++ b/lib/api/commits.rb
@@ -41,7 +41,7 @@ module API
detail 'This feature was introduced in GitLab 8.13'
end
params do
- requires :branch_name, type: String, desc: 'The name of branch'
+ requires :branch, type: String, desc: 'The name of branch'
requires :commit_message, type: String, desc: 'Commit message'
requires :actions, type: Array[Hash], desc: 'Actions to perform in commit'
optional :author_email, type: String, desc: 'Author email for commit'
@@ -50,9 +50,8 @@ module API
post ":id/repository/commits" do
authorize! :push_code, user_project
- attrs = declared_params
- attrs[:start_branch] = attrs[:branch_name]
- attrs[:target_branch] = attrs[:branch_name]
+ attrs = declared_params.merge(start_branch: declared_params[:branch], target_branch: declared_params[:branch])
+
attrs[:actions].map! do |action|
action[:action] = action[:action].to_sym
action[:file_path].slice!(0) if action[:file_path] && action[:file_path].start_with?('/')