File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 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 {
162162 return nil
163163 }
164164
165+ protectedBranches , err := ctx .Repo .Repository .GetProtectedBranches ()
166+ if err != nil {
167+ ctx .ServerError ("GetProtectedBranches" , err )
168+ return nil
169+ }
170+
165171 branches := make ([]* Branch , len (rawBranches ))
166172 for i := range rawBranches {
167173 commit , err := rawBranches [i ].GetCommit ()
@@ -170,11 +176,13 @@ func loadBranches(ctx *context.Context) []*Branch {
170176 return nil
171177 }
172178
179+ var isProtected bool
173180 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+ }
178186 }
179187
180188 divergence , divergenceError := repofiles .CountDivergingCommits (ctx .Repo .Repository , branchName )
You can’t perform that action at this time.
0 commit comments