diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-02-02 12:24:30 -0200 |
---|---|---|
committer | Oswaldo Ferreira <oswluizf@gmail.com> | 2017-02-21 16:33:14 -0300 |
commit | c79bbe26ab1e16facddaf159d4d074937586d742 (patch) | |
tree | 8b62ca587ac78806aa59fd53fba67e375e84fca6 /lib/api/commits.rb | |
parent | 51546e26d7aa904a69090004de57d03dbe7268d7 (diff) | |
download | gitlab-ce-c79bbe26ab1e16facddaf159d4d074937586d742.tar.gz |
Change branch_name param to branch throughout V4 API22132-rename-branch-name-params-to-branch
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r-- | lib/api/commits.rb | 7 |
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?('/') |