Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API branch protection endpoint #9311

Merged
merged 23 commits into from
Feb 12, 2020
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5e0302a
add API branch protection endpoint
davidsvantesson Nov 17, 2019
f0e082d
lint
davidsvantesson Dec 10, 2019
44a6bb2
Merge branch 'master' into api-branch-protection
davidsvantesson Jan 18, 2020
a46dbc2
Change to use team names instead of ids.
davidsvantesson Jan 18, 2020
637d10f
Status codes.
davidsvantesson Jan 18, 2020
5d83df5
fix
davidsvantesson Jan 18, 2020
8d38799
Merge branch 'master' into api-branch-protection
davidsvantesson Jan 25, 2020
2234a59
Fix
davidsvantesson Jan 25, 2020
606fbbc
Add new branch protection options (BlockOnRejectedReviews, DismissSta…
davidsvantesson Jan 25, 2020
ba86c20
Do xorm query directly
davidsvantesson Jan 26, 2020
2d86ed1
fix xorm GetUserNamesByIDs
davidsvantesson Jan 26, 2020
92583c3
Add some tests
davidsvantesson Jan 26, 2020
ed778e6
Improved GetTeamNamesByID
davidsvantesson Jan 27, 2020
cf41723
Merge branch 'master' into api-branch-protection
davidsvantesson Jan 27, 2020
3ccc769
http status created for CreateBranchProtection
davidsvantesson Feb 4, 2020
9b285d3
Correct status code in integration test
davidsvantesson Feb 4, 2020
9a49639
Merge branch 'master' into api-branch-protection
davidsvantesson Feb 4, 2020
28ddd9b
Merge branch 'master' into api-branch-protection
lunny Feb 7, 2020
dba6051
Merge branch 'master' into api-branch-protection
davidsvantesson Feb 7, 2020
afdd144
Merge branch 'master' into api-branch-protection
lunny Feb 7, 2020
4cd0cf0
Merge branch 'master' into api-branch-protection
davidsvantesson Feb 10, 2020
122fb8c
Merge branch 'master' into api-branch-protection
lunny Feb 11, 2020
35300c3
Merge branch 'master' into api-branch-protection
zeripath Feb 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
davidsvantesson committed Dec 10, 2019
commit f0e082dd2bbd1c056e909ded9bd5596cb1a74154
4 changes: 2 additions & 2 deletions routers/api/v1/repo/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,14 @@ func EditBranchProtection(ctx *context.APIContext, form api.EditBranchProtection
}

if form.EnablePush != nil {
if *form.EnablePush == false {
if !*form.EnablePush {
protectBranch.CanPush = false
protectBranch.EnableWhitelist = false
protectBranch.WhitelistDeployKeys = false
} else {
protectBranch.CanPush = true
if form.EnablePushWhitelist != nil {
if *form.EnablePushWhitelist == false {
if !*form.EnablePushWhitelist {
protectBranch.EnableWhitelist = false
protectBranch.WhitelistDeployKeys = false
} else {
Expand Down