Skip to content

Commit b82ac60

Browse files
committed
Removed unused method.
1 parent 02297d4 commit b82ac60

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

models/branches.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -375,27 +375,6 @@ func (repo *Repository) IsProtectedBranch(branchName string) (bool, error) {
375375
return has, nil
376376
}
377377

378-
// IsProtectedBranchForPush checks if branch is protected for push
379-
func (repo *Repository) IsProtectedBranchForPush(branchName string, doer *User) (bool, error) {
380-
if doer == nil {
381-
return true, nil
382-
}
383-
384-
protectedBranch := &ProtectedBranch{
385-
RepoID: repo.ID,
386-
BranchName: branchName,
387-
}
388-
389-
has, err := x.Get(protectedBranch)
390-
if err != nil {
391-
return true, err
392-
} else if has {
393-
return !protectedBranch.CanUserPush(doer.ID), nil
394-
}
395-
396-
return false, nil
397-
}
398-
399378
// updateApprovalWhitelist checks whether the user whitelist changed and returns a whitelist with
400379
// the users from newWhitelist which have explicit read or write access to the repo.
401380
func updateApprovalWhitelist(repo *Repository, currentWhitelist, newWhitelist []int64) (whitelist []int64, err error) {

0 commit comments

Comments
 (0)