소스 검색

models: bug fix for query protected branches (#5054)

Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
Wendell Sun 7 년 전
부모
커밋
e4f187cd3d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      models/repo_branch.go

+ 1 - 1
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)
 }