diff options
author | Nick Thomas <nick@gitlab.com> | 2018-09-17 16:14:58 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-09-17 16:14:58 +0300 |
commit | 3c5c658a27d1dfe4abf6469f35776b78f2169d81 (patch) | |
tree | ffbbb40d70490c3df2eafd4ccac9cb3b9cd3f23e /app/services/files/base_service.rb | |
parent | 983bd38f9189a5c7c470f76f7a83044ec7259d21 (diff) |
Use the correct email address when committing via a file service
Diffstat (limited to 'app/services/files/base_service.rb')
-rw-r--r-- | app/services/files/base_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb index fc7b236f7da..39e614d6569 100644 --- a/app/services/files/base_service.rb +++ b/app/services/files/base_service.rb @@ -7,8 +7,10 @@ module Files def initialize(*args) super - @author_email = params[:author_email] || current_user&.email - @author_name = params[:author_name] || current_user&.name + git_user = Gitlab::Git::User.from_gitlab(current_user) if current_user.present? + + @author_email = params[:author_email] || git_user&.email + @author_name = params[:author_name] || git_user&.name @commit_message = params[:commit_message] @last_commit_sha = params[:last_commit_sha] |