Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
This commit is contained in:
parent
e55eaa8545
commit
d87fb0a6fd
1 changed files with 4 additions and 0 deletions
|
@ -156,6 +156,10 @@ func (repo *Repository) GetProtectedBranches() ([]*ProtectedBranch, error) {
|
||||||
|
|
||||||
// IsProtectedBranch checks if branch is protected
|
// IsProtectedBranch checks if branch is protected
|
||||||
func (repo *Repository) IsProtectedBranch(branchName string, doer *User) (bool, error) {
|
func (repo *Repository) IsProtectedBranch(branchName string, doer *User) (bool, error) {
|
||||||
|
if doer == nil {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
protectedBranch := &ProtectedBranch{
|
protectedBranch := &ProtectedBranch{
|
||||||
RepoID: repo.ID,
|
RepoID: repo.ID,
|
||||||
BranchName: branchName,
|
BranchName: branchName,
|
||||||
|
|
Reference in a new issue