@@ -520,14 +520,14 @@ func DeleteProtectedBranch(ctx context.Context, repo *repo_model.Repository, id
520
520
521
521
// RemoveUserIDFromProtectedBranch remove all user ids from protected branch options
522
522
func RemoveUserIDFromProtectedBranch (ctx context.Context , p * ProtectedBranch , userID int64 ) error {
523
- lenIDs , lenApprovalIDs , lenMergeIDs := len (p .WhitelistUserIDs ), len (p .ApprovalsWhitelistUserIDs ), len (p .MergeWhitelistUserIDs )
523
+ lenIDs , lenForcePushIDs , lenApprovalIDs , lenMergeIDs := len (p .WhitelistUserIDs ), len ( p . ForcePushWhitelistUserIDs ), len (p .ApprovalsWhitelistUserIDs ), len (p .MergeWhitelistUserIDs )
524
524
p .WhitelistUserIDs = util .SliceRemoveAll (p .WhitelistUserIDs , userID )
525
525
p .ForcePushWhitelistUserIDs = util .SliceRemoveAll (p .ForcePushWhitelistUserIDs , userID )
526
526
p .ApprovalsWhitelistUserIDs = util .SliceRemoveAll (p .ApprovalsWhitelistUserIDs , userID )
527
527
p .MergeWhitelistUserIDs = util .SliceRemoveAll (p .MergeWhitelistUserIDs , userID )
528
528
529
529
if lenIDs != len (p .WhitelistUserIDs ) ||
530
- lenApprovalIDs != len (p .ForcePushWhitelistUserIDs ) ||
530
+ lenForcePushIDs != len (p .ForcePushWhitelistUserIDs ) ||
531
531
lenApprovalIDs != len (p .ApprovalsWhitelistUserIDs ) ||
532
532
lenMergeIDs != len (p .MergeWhitelistUserIDs ) {
533
533
if _ , err := db .GetEngine (ctx ).ID (p .ID ).Cols (
@@ -544,12 +544,14 @@ func RemoveUserIDFromProtectedBranch(ctx context.Context, p *ProtectedBranch, us
544
544
545
545
// RemoveTeamIDFromProtectedBranch remove all team ids from protected branch options
546
546
func RemoveTeamIDFromProtectedBranch (ctx context.Context , p * ProtectedBranch , teamID int64 ) error {
547
- lenIDs , lenApprovalIDs , lenMergeIDs := len (p .WhitelistTeamIDs ), len (p .ApprovalsWhitelistTeamIDs ), len (p .MergeWhitelistTeamIDs )
547
+ lenIDs , lenForcePushIDs , lenApprovalIDs , lenMergeIDs := len (p .WhitelistTeamIDs ), len ( p . ForcePushWhitelistTeamIDs ), len (p .ApprovalsWhitelistTeamIDs ), len (p .MergeWhitelistTeamIDs )
548
548
p .WhitelistTeamIDs = util .SliceRemoveAll (p .WhitelistTeamIDs , teamID )
549
+ p .ForcePushWhitelistTeamIDs = util .SliceRemoveAll (p .ForcePushWhitelistTeamIDs , teamID )
549
550
p .ApprovalsWhitelistTeamIDs = util .SliceRemoveAll (p .ApprovalsWhitelistTeamIDs , teamID )
550
551
p .MergeWhitelistTeamIDs = util .SliceRemoveAll (p .MergeWhitelistTeamIDs , teamID )
551
552
552
553
if lenIDs != len (p .WhitelistTeamIDs ) ||
554
+ lenForcePushIDs != len (p .ForcePushWhitelistTeamIDs ) ||
553
555
lenApprovalIDs != len (p .ApprovalsWhitelistTeamIDs ) ||
554
556
lenMergeIDs != len (p .MergeWhitelistTeamIDs ) {
555
557
if _ , err := db .GetEngine (ctx ).ID (p .ID ).Cols (
0 commit comments