summaryrefslogtreecommitdiff
path: root/app/services/suggestions
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /app/services/suggestions
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
downloadgitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/services/suggestions')
-rw-r--r--app/services/suggestions/apply_service.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/services/suggestions/apply_service.rb b/app/services/suggestions/apply_service.rb
index f9783f4271f..6836700a67d 100644
--- a/app/services/suggestions/apply_service.rb
+++ b/app/services/suggestions/apply_service.rb
@@ -36,12 +36,22 @@ module Suggestions
.track_apply_suggestion_action(user: current_user)
end
+ def author
+ authors = suggestion_set.authors
+
+ return unless authors.one?
+
+ Gitlab::Git::User.from_gitlab(authors.first)
+ end
+
def multi_service
params = {
commit_message: commit_message,
branch_name: suggestion_set.branch,
start_branch: suggestion_set.branch,
- actions: suggestion_set.actions
+ actions: suggestion_set.actions,
+ author_name: author&.name,
+ author_email: author&.email
}
::Files::MultiService.new(suggestion_set.project, current_user, params)