summaryrefslogtreecommitdiffstats
path: root/modules/convert
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2020-11-29 03:30:46 +0800
committerGitHub <noreply@github.com>2020-11-28 21:30:46 +0200
commit9c26dc1f3a742280baff4e9578545bc822016764 (patch)
treeac997d23e59a658b387302ecd65e76a39d99b9e8 /modules/convert
parent7ed5bf8cbe06bf2cfc4980cf6e020dc46dd71a79 (diff)
downloadgitea-9c26dc1f3a742280baff4e9578545bc822016764.tar.gz
gitea-9c26dc1f3a742280baff4e9578545bc822016764.zip
Add block on official review requests branch protection (#13705)
Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/convert')
-rw-r--r--modules/convert/convert.go45
1 files changed, 23 insertions, 22 deletions
diff --git a/modules/convert/convert.go b/modules/convert/convert.go
index 5d056c3795..9b20c683be 100644
--- a/modules/convert/convert.go
+++ b/modules/convert/convert.go
@@ -105,28 +105,29 @@ func ToBranchProtection(bp *models.ProtectedBranch) *api.BranchProtection {
}
return &api.BranchProtection{
- BranchName: bp.BranchName,
- EnablePush: bp.CanPush,
- EnablePushWhitelist: bp.EnableWhitelist,
- PushWhitelistUsernames: pushWhitelistUsernames,
- PushWhitelistTeams: pushWhitelistTeams,
- PushWhitelistDeployKeys: bp.WhitelistDeployKeys,
- EnableMergeWhitelist: bp.EnableMergeWhitelist,
- MergeWhitelistUsernames: mergeWhitelistUsernames,
- MergeWhitelistTeams: mergeWhitelistTeams,
- EnableStatusCheck: bp.EnableStatusCheck,
- StatusCheckContexts: bp.StatusCheckContexts,
- RequiredApprovals: bp.RequiredApprovals,
- EnableApprovalsWhitelist: bp.EnableApprovalsWhitelist,
- ApprovalsWhitelistUsernames: approvalsWhitelistUsernames,
- ApprovalsWhitelistTeams: approvalsWhitelistTeams,
- BlockOnRejectedReviews: bp.BlockOnRejectedReviews,
- BlockOnOutdatedBranch: bp.BlockOnOutdatedBranch,
- DismissStaleApprovals: bp.DismissStaleApprovals,
- RequireSignedCommits: bp.RequireSignedCommits,
- ProtectedFilePatterns: bp.ProtectedFilePatterns,
- Created: bp.CreatedUnix.AsTime(),
- Updated: bp.UpdatedUnix.AsTime(),
+ BranchName: bp.BranchName,
+ EnablePush: bp.CanPush,
+ EnablePushWhitelist: bp.EnableWhitelist,
+ PushWhitelistUsernames: pushWhitelistUsernames,
+ PushWhitelistTeams: pushWhitelistTeams,
+ PushWhitelistDeployKeys: bp.WhitelistDeployKeys,
+ EnableMergeWhitelist: bp.EnableMergeWhitelist,
+ MergeWhitelistUsernames: mergeWhitelistUsernames,
+ MergeWhitelistTeams: mergeWhitelistTeams,
+ EnableStatusCheck: bp.EnableStatusCheck,
+ StatusCheckContexts: bp.StatusCheckContexts,
+ RequiredApprovals: bp.RequiredApprovals,
+ EnableApprovalsWhitelist: bp.EnableApprovalsWhitelist,
+ ApprovalsWhitelistUsernames: approvalsWhitelistUsernames,
+ ApprovalsWhitelistTeams: approvalsWhitelistTeams,
+ BlockOnRejectedReviews: bp.BlockOnRejectedReviews,
+ BlockOnOfficialReviewRequests: bp.BlockOnOfficialReviewRequests,
+ BlockOnOutdatedBranch: bp.BlockOnOutdatedBranch,
+ DismissStaleApprovals: bp.DismissStaleApprovals,
+ RequireSignedCommits: bp.RequireSignedCommits,
+ ProtectedFilePatterns: bp.ProtectedFilePatterns,
+ Created: bp.CreatedUnix.AsTime(),
+ Updated: bp.UpdatedUnix.AsTime(),
}
}