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>2020-06-23 03:08:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-23 03:08:58 +0300
commit94221585cabf666f38ac989978838393fc3bf56e (patch)
tree54cae93eba04c045b3b2037bbcdbaf913320c9c6 /app/models
parent2319d04d069d5e066e35cc44035239b21d3fae32 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/merge_request.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index adf4c0ffa15..68ff336a1bb 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -946,7 +946,8 @@ class MergeRequest < ApplicationRecord
end
def can_remove_source_branch?(current_user)
- !ProtectedBranch.protected?(source_project, source_branch) &&
+ source_project &&
+ !ProtectedBranch.protected?(source_project, source_branch) &&
!source_project.root_ref?(source_branch) &&
Ability.allowed?(current_user, :push_code, source_project) &&
diff_head_sha == source_branch_head.try(:sha)