Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-24 03:07:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-24 03:07:27 +0300
commit179b33c5465649ee5d020f70604f1b02473fc702 (patch)
treef2883044ea8126a7b5774ec2ff7750940a443246 /lib/gitlab/suggestions
parentbbc06065aa40c3d0d037bea16081f4f5c969053e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/suggestions')
-rw-r--r--lib/gitlab/suggestions/commit_message.rb6
-rw-r--r--lib/gitlab/suggestions/suggestion_set.rb8
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/gitlab/suggestions/commit_message.rb b/lib/gitlab/suggestions/commit_message.rb
index 5bca3efe6e1..fcf30cd6df9 100644
--- a/lib/gitlab/suggestions/commit_message.rb
+++ b/lib/gitlab/suggestions/commit_message.rb
@@ -13,7 +13,7 @@ module Gitlab
end
def message
- project = suggestion_set.project
+ project = suggestion_set.target_project
user_defined_message = @custom_message.presence || project.suggestion_commit_message.presence
message = user_defined_message || DEFAULT_SUGGESTION_COMMIT_MESSAGE
@@ -37,8 +37,8 @@ module Gitlab
'branch_name' => ->(user, suggestion_set) { suggestion_set.branch },
'files_count' => ->(user, suggestion_set) { suggestion_set.file_paths.length },
'file_paths' => ->(user, suggestion_set) { format_paths(suggestion_set.file_paths) },
- 'project_name' => ->(user, suggestion_set) { suggestion_set.project.name },
- 'project_path' => ->(user, suggestion_set) { suggestion_set.project.path },
+ 'project_name' => ->(user, suggestion_set) { suggestion_set.target_project.name },
+ 'project_path' => ->(user, suggestion_set) { suggestion_set.target_project.path },
'user_full_name' => ->(user, suggestion_set) { user.name },
'username' => ->(user, suggestion_set) { user.username },
'suggestions_count' => ->(user, suggestion_set) { suggestion_set.suggestions.size }
diff --git a/lib/gitlab/suggestions/suggestion_set.rb b/lib/gitlab/suggestions/suggestion_set.rb
index 53885cdbf19..21a5acf8afe 100644
--- a/lib/gitlab/suggestions/suggestion_set.rb
+++ b/lib/gitlab/suggestions/suggestion_set.rb
@@ -9,8 +9,12 @@ module Gitlab
@suggestions = suggestions
end
- def project
- first_suggestion.project
+ def source_project
+ first_suggestion.source_project
+ end
+
+ def target_project
+ first_suggestion.target_project
end
def branch