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:
authorPatrick Bajao <ebajao@gitlab.com>2019-06-29 01:08:26 +0300
committerPatrick Bajao <ebajao@gitlab.com>2019-06-28 19:22:09 +0300
commit1ca5520bd6f3447ada3a1120d2a3bd445ab6746a (patch)
tree30de757277f2948f38357fc78b3b1792975394d3 /app/controllers
parentac3de494bde32e4ce13bd665d1de3132b84c002d (diff)
Fix issues when creating system notes
When `confidential_issue_project_id` is set and the issue is under that project, create the a note about branch creation in that project. If not, do nothing. When creating `new_merge_request` system note, set the project where the MR will be referenced from so it'll be linked to when the MR is created in another project.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/branches_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index df4002d075b..b3dfafb7b87 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -64,8 +64,9 @@ class Projects::BranchesController < Projects::ApplicationController
success = (result[:status] == :success)
if params[:issue_iid] && success
- issue = IssuesFinder.new(current_user, project_id: (confidential_issue_project || @project).id).find_by(iid: params[:issue_iid])
- SystemNoteService.new_issue_branch(issue, @project, current_user, branch_name) if issue
+ target_project = confidential_issue_project || @project
+ issue = IssuesFinder.new(current_user, project_id: target_project.id).find_by(iid: params[:issue_iid])
+ SystemNoteService.new_issue_branch(issue, target_project, current_user, branch_name, branch_project: @project) if issue
end
respond_to do |format|