mirror of
https://github.com/gogs/gogs.git
synced 2025-05-31 11:42:13 +00:00
models: bug fix for query protected branches (#5054)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
This commit is contained in:
parent
f9c706e31b
commit
e4f187cd3d
@ -252,5 +252,5 @@ func UpdateOrgProtectBranch(repo *Repository, protectBranch *ProtectBranch, whit
|
|||||||
// GetProtectBranchesByRepoID returns a list of *ProtectBranch in given repostiory.
|
// GetProtectBranchesByRepoID returns a list of *ProtectBranch in given repostiory.
|
||||||
func GetProtectBranchesByRepoID(repoID int64) ([]*ProtectBranch, error) {
|
func GetProtectBranchesByRepoID(repoID int64) ([]*ProtectBranch, error) {
|
||||||
protectBranches := make([]*ProtectBranch, 0, 2)
|
protectBranches := make([]*ProtectBranch, 0, 2)
|
||||||
return protectBranches, x.Where("repo_id = ?", repoID).Asc("name").Find(&protectBranches)
|
return protectBranches, x.Where("repo_id = ? and protected=true", repoID).Asc("name").Find(&protectBranches)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user