diff options
author | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2021-03-31 19:41:24 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2021-03-31 19:41:24 +0300 |
commit | 38b3003b67db3f2eadfa81fd28b13d168f665766 (patch) | |
tree | be836d10a991163527d2e349ff1e770276ecbea2 /app | |
parent | b2ce3643e27db4cc0ad30cc09d651c00ec799887 (diff) | |
parent | c93927607f55350f2e2af4bdaf03ff9dba80ab1d (diff) |
Merge remote-tracking branch 'dev/13-10-stable' into 13-10-stable
Diffstat (limited to 'app')
-rw-r--r-- | app/models/merge_request.rb | 4 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/services/projects/unlink_fork_service.rb | 2 | ||||
-rw-r--r-- | app/views/shared/issuable/_sidebar.html.haml | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index ac50e5c5107..7efdd79ae1c 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -1337,8 +1337,8 @@ class MergeRequest < ApplicationRecord has_no_commits? || branch_missing? || cannot_be_merged? end - def can_be_merged_by?(user) - access = ::Gitlab::UserAccess.new(user, container: project) + def can_be_merged_by?(user, skip_collaboration_check: false) + access = ::Gitlab::UserAccess.new(user, container: project, skip_collaboration_check: skip_collaboration_check) access.can_update_branch?(target_branch) end diff --git a/app/models/project.rb b/app/models/project.rb index 274dae8fd65..c52eb95bde8 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -2704,7 +2704,7 @@ class Project < ApplicationRecord # Issue for N+1: https://gitlab.com/gitlab-org/gitlab-foss/issues/49322 Gitlab::GitalyClient.allow_n_plus_1_calls do merge_requests_allowing_collaboration(branch_name).any? do |merge_request| - merge_request.can_be_merged_by?(user) + merge_request.can_be_merged_by?(user, skip_collaboration_check: true) end end end diff --git a/app/services/projects/unlink_fork_service.rb b/app/services/projects/unlink_fork_service.rb index 6ba3356d612..91632e50ba8 100644 --- a/app/services/projects/unlink_fork_service.rb +++ b/app/services/projects/unlink_fork_service.rb @@ -32,6 +32,8 @@ module Projects if fork_network = @project.root_of_fork_network fork_network.update(root_project: nil, deleted_root_project_name: @project.full_name) end + + @project.leave_pool_repository end # rubocop: disable Cop/InBatches diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 7a1bb9dd3ca..787d9db1192 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -138,7 +138,7 @@ = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport') .sidebar-mr-source-branch.hide-collapsed %span - = _('Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}').html_safe % { source_branch_open: "<cite class='ref-name' title='#{source_branch}'>".html_safe, source_branch_close: "</cite>".html_safe, source_branch: source_branch } + = _('Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}').html_safe % { source_branch_open: "<cite class='ref-name' title='#{html_escape(source_branch)}'>".html_safe, source_branch_close: "</cite>".html_safe, source_branch: html_escape(source_branch) } = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport') - if show_forwarding_email |