diff options
author | Wendell Sun <iwendellsun@gmail.com> | 2018-03-07 06:11:31 +0800 |
---|---|---|
committer | jc <u@gogs.io> | 2018-03-06 17:11:31 -0500 |
commit | e4f187cd3d7e7cbc69b1bdf9ec58b4191c67aa7d (patch) | |
tree | b218984f1db876611ebec1b8a826cd42b66905af | |
parent | f9c706e31bda08a0c25e86d26a0d5692c0cdeed6 (diff) |
models: bug fix for query protected branches (#5054)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
-rw-r--r-- | models/repo_branch.go | 2 |
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) } |