Skip to content

Commit d52b8a8

Browse files
committed
as per @lunny ... finished
1 parent 3c17638 commit d52b8a8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

models/git/protected_branch.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,18 @@ func IsRuleNameSpecial(ruleName string) bool {
8484

8585
func (protectBranch *ProtectedBranch) loadGlob() {
8686
if protectBranch.isPlainName || protectBranch.globRule != nil {
87-
return
88-
// detect if it is not glob
89-
if !IsRuleNameSpecial(protectBranch.RuleName) {
90-
protectBranch.isPlainName = true
91-
return
92-
}
93-
var err error
94-
protectBranch.globRule, err = glob.Compile(protectBranch.RuleName, '/')
95-
if err != nil {
96-
log.Warn("Invalid glob rule for ProtectedBranch[%d]: %s %v", protectBranch.ID, protectBranch.RuleName, err)
97-
protectBranch.globRule = glob.MustCompile(glob.QuoteMeta(protectBranch.RuleName), '/')
98-
}
87+
return
88+
}
89+
// detect if it is not glob
90+
if !IsRuleNameSpecial(protectBranch.RuleName) {
91+
protectBranch.isPlainName = true
92+
return
93+
}
94+
var err error
95+
protectBranch.globRule, err = glob.Compile(protectBranch.RuleName, '/')
96+
if err != nil {
97+
log.Warn("Invalid glob rule for ProtectedBranch[%d]: %s %v", protectBranch.ID, protectBranch.RuleName, err)
98+
protectBranch.globRule = glob.MustCompile(glob.QuoteMeta(protectBranch.RuleName), '/')
9999
}
100100
}
101101

0 commit comments

Comments
 (0)