diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-20 15:30:00 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-20 15:30:00 +0000 |
commit | f0bda348bbc382d4aef4261635e7416ab190ba56 (patch) | |
tree | e41c00198d7869d7e50adcf8a07ffaf878994817 /lib/api | |
parent | 31ff272f763a93b944cd288cc35c54e5c2645ebd (diff) | |
parent | ace11553966cc7c313e666672de8c45418139429 (diff) | |
download | gitlab-ce-f0bda348bbc382d4aef4261635e7416ab190ba56.tar.gz |
Merge branch 'add_optional_author_for_commits' into 'master'
Add optional 'author' param when making commits
This fulfills https://gitlab.com/gitlab-org/gitlab-ce/issues/20789 by adding the ability to specify a user's ID to be used as the author of a commit.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20789
See merge request !5822
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/files.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb index c1d86f313b0..96510e651a3 100644 --- a/lib/api/files.rb +++ b/lib/api/files.rb @@ -11,14 +11,16 @@ module API target_branch: attrs[:branch_name], commit_message: attrs[:commit_message], file_content: attrs[:content], - file_content_encoding: attrs[:encoding] + file_content_encoding: attrs[:encoding], + author_email: attrs[:author_email], + author_name: attrs[:author_name] } end def commit_response(attrs) { file_path: attrs[:file_path], - branch_name: attrs[:branch_name], + branch_name: attrs[:branch_name] } end end @@ -96,7 +98,7 @@ module API authorize! :push_code, user_project required_attributes! [:file_path, :branch_name, :content, :commit_message] - attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding] + attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding, :author_email, :author_name] result = ::Files::CreateService.new(user_project, current_user, commit_params(attrs)).execute if result[:status] == :success @@ -122,7 +124,7 @@ module API authorize! :push_code, user_project required_attributes! [:file_path, :branch_name, :content, :commit_message] - attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding] + attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding, :author_email, :author_name] result = ::Files::UpdateService.new(user_project, current_user, commit_params(attrs)).execute if result[:status] == :success @@ -149,7 +151,7 @@ module API authorize! :push_code, user_project required_attributes! [:file_path, :branch_name, :commit_message] - attrs = attributes_for_keys [:file_path, :branch_name, :commit_message] + attrs = attributes_for_keys [:file_path, :branch_name, :commit_message, :author_email, :author_name] result = ::Files::DeleteService.new(user_project, current_user, commit_params(attrs)).execute if result[:status] == :success |