diff options
author | Dan Dunckel <dldunckel@gmail.com> | 2016-09-08 18:40:07 +0300 |
---|---|---|
committer | Dan Dunckel <dldunckel@gmail.com> | 2016-09-19 20:00:26 +0300 |
commit | ace11553966cc7c313e666672de8c45418139429 (patch) | |
tree | bb13662cbe6c39928e2149d0c1ee37f0a97d0b75 /app/services | |
parent | b94de5fd555213ae28030c33c27440228f8efb65 (diff) |
Add optional 'author' param when making commits
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/files/base_service.rb | 2 | ||||
-rw-r--r-- | app/services/files/create_dir_service.rb | 2 | ||||
-rw-r--r-- | app/services/files/create_service.rb | 2 | ||||
-rw-r--r-- | app/services/files/delete_service.rb | 2 | ||||
-rw-r--r-- | app/services/files/update_service.rb | 4 |
5 files changed, 8 insertions, 4 deletions
diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb index ea94818713b..e8465729d06 100644 --- a/app/services/files/base_service.rb +++ b/app/services/files/base_service.rb @@ -16,6 +16,8 @@ module Files params[:file_content] end @last_commit_sha = params[:last_commit_sha] + @author_email = params[:author_email] + @author_name = params[:author_name] # Validate parameters validate diff --git a/app/services/files/create_dir_service.rb b/app/services/files/create_dir_service.rb index 6107254a34e..d00d78cee7e 100644 --- a/app/services/files/create_dir_service.rb +++ b/app/services/files/create_dir_service.rb @@ -3,7 +3,7 @@ require_relative "base_service" module Files class CreateDirService < Files::BaseService def commit - repository.commit_dir(current_user, @file_path, @commit_message, @target_branch) + repository.commit_dir(current_user, @file_path, @commit_message, @target_branch, author_email: @author_email, author_name: @author_name) end def validate diff --git a/app/services/files/create_service.rb b/app/services/files/create_service.rb index 8eaf6db8012..bf127843d55 100644 --- a/app/services/files/create_service.rb +++ b/app/services/files/create_service.rb @@ -3,7 +3,7 @@ require_relative "base_service" module Files class CreateService < Files::BaseService def commit - repository.commit_file(current_user, @file_path, @file_content, @commit_message, @target_branch, false) + repository.commit_file(current_user, @file_path, @file_content, @commit_message, @target_branch, false, author_email: @author_email, author_name: @author_name) end def validate diff --git a/app/services/files/delete_service.rb b/app/services/files/delete_service.rb index 27c881c3430..8b27ad51789 100644 --- a/app/services/files/delete_service.rb +++ b/app/services/files/delete_service.rb @@ -3,7 +3,7 @@ require_relative "base_service" module Files class DeleteService < Files::BaseService def commit - repository.remove_file(current_user, @file_path, @commit_message, @target_branch) + repository.remove_file(current_user, @file_path, @commit_message, @target_branch, author_email: @author_email, author_name: @author_name) end end end diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb index 4fc3b640799..9e9b5b63f26 100644 --- a/app/services/files/update_service.rb +++ b/app/services/files/update_service.rb @@ -8,7 +8,9 @@ module Files repository.update_file(current_user, @file_path, @file_content, branch: @target_branch, previous_path: @previous_path, - message: @commit_message) + message: @commit_message, + author_email: @author_email, + author_name: @author_name) end private |