File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,12 @@ func loadBranches(ctx *context.Context) []*Branch {
162
162
return nil
163
163
}
164
164
165
+ protectedBranches , err := ctx .Repo .Repository .GetProtectedBranches ()
166
+ if err != nil {
167
+ ctx .ServerError ("GetProtectedBranches" , err )
168
+ return nil
169
+ }
170
+
165
171
branches := make ([]* Branch , len (rawBranches ))
166
172
for i := range rawBranches {
167
173
commit , err := rawBranches [i ].GetCommit ()
@@ -170,11 +176,13 @@ func loadBranches(ctx *context.Context) []*Branch {
170
176
return nil
171
177
}
172
178
179
+ var isProtected bool
173
180
branchName := rawBranches [i ].Name
174
- isProtected , err := ctx .Repo .Repository .IsProtectedBranch (branchName , ctx .User )
175
- if err != nil {
176
- ctx .ServerError ("IsProtectedBranch" , err )
177
- return nil
181
+ for _ , b := range protectedBranches {
182
+ if b .BranchName == branchName {
183
+ isProtected = true
184
+ break
185
+ }
178
186
}
179
187
180
188
divergence , divergenceError := repofiles .CountDivergingCommits (ctx .Repo .Repository , branchName )
You can’t perform that action at this time.
0 commit comments