BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ec8d438d
Commit
ec8d438d
authored
Nov 30, 2017
by
Douwe Maan
Committed by
Winnie Hellmann
Dec 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'protected-branches-names' into 'master'
Only load branch names for protected branch checks See merge request gitlab-org/gitlab-ce!15629 (cherry picked from commit
1aaa6095
)
a0527ab8
Only load branch names for protected branch checks
parent
ce513abb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
protected_branch.rb
app/models/protected_branch.rb
+3
-1
protected_tag.rb
app/models/protected_tag.rb
+3
-1
protected-branches-names.yml
changelogs/unreleased/protected-branches-names.yml
+5
-0
No files found.
app/models/protected_branch.rb
View file @
ec8d438d
...
...
@@ -10,7 +10,9 @@ class ProtectedBranch < ActiveRecord::Base
def
self
.
protected?
(
project
,
ref_name
)
return
true
if
project
.
empty_repo?
&&
default_branch_protected?
self
.
matching
(
ref_name
,
protected_refs:
project
.
protected_branches
).
present?
refs
=
project
.
protected_branches
.
select
(
:name
)
self
.
matching
(
ref_name
,
protected_refs:
refs
).
present?
end
def
self
.
default_branch_protected?
...
...
app/models/protected_tag.rb
View file @
ec8d438d
...
...
@@ -5,6 +5,8 @@ class ProtectedTag < ActiveRecord::Base
protected_ref_access_levels
:create
def
self
.
protected?
(
project
,
ref_name
)
self
.
matching
(
ref_name
,
protected_refs:
project
.
protected_tags
).
present?
refs
=
project
.
protected_tags
.
select
(
:name
)
self
.
matching
(
ref_name
,
protected_refs:
refs
).
present?
end
end
changelogs/unreleased/protected-branches-names.yml
0 → 100644
View file @
ec8d438d
---
title
:
Only load branch names for protected branch checks
merge_request
:
author
:
type
:
performance
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment