mirror of
https://github.com/go-gitea/gitea
synced 2025-08-12 04:28:21 +00:00
Fix deletion of unprotected branches (#2630)
* fix deletion of unprotected branches * fmt fix * changed internal protected branch api * fix lint error Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
This commit is contained in:
committed by
Lauris BH
parent
3cc5b11b0d
commit
e38e502e20
@@ -38,6 +38,11 @@ func (protectBranch *ProtectedBranch) BeforeUpdate() {
|
||||
protectBranch.UpdatedUnix = time.Now().Unix()
|
||||
}
|
||||
|
||||
// IsProtected returns if the branch is protected
|
||||
func (protectBranch *ProtectedBranch) IsProtected() bool {
|
||||
return protectBranch.ID > 0
|
||||
}
|
||||
|
||||
// GetProtectedBranchByRepoID getting protected branch by repo ID
|
||||
func GetProtectedBranchByRepoID(RepoID int64) ([]*ProtectedBranch, error) {
|
||||
protectedBranches := make([]*ProtectedBranch, 0)
|
||||
|
Reference in New Issue
Block a user