aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--models/repo_branch.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo_branch.go b/models/repo_branch.go
index 76fd592f..10931b0c 100644
--- a/models/repo_branch.go
+++ b/models/repo_branch.go
@@ -252,5 +252,5 @@ func UpdateOrgProtectBranch(repo *Repository, protectBranch *ProtectBranch, whit
// GetProtectBranchesByRepoID returns a list of *ProtectBranch in given repostiory.
func GetProtectBranchesByRepoID(repoID int64) ([]*ProtectBranch, error) {
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)
}