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-07-28 21:09:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-28 21:09:03 +0300
commitb420660ef1369fec4d09b7bf5e961d81980974e5 (patch)
treef096fdd1bd3b4898e1b2ca80957ce68c200c09f0 /app/models/repository.rb
parentb8026fd558e7ec154c626208a33c1485aec8f4ea (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 0da71d87457..9039bdf1a20 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -1168,6 +1168,16 @@ class Repository
@cache ||= Gitlab::RepositoryCache.new(self)
end
+ def remove_prohibited_branches
+ return unless exists?
+
+ prohibited_branches = raw_repository.branch_names.select { |name| name.match(/\A\h{40}\z/) }
+
+ return if prohibited_branches.blank?
+
+ prohibited_branches.each { |name| raw_repository.delete_branch(name) }
+ end
+
private
# TODO Genericize finder, later split this on finders by Ref or Oid