diff --git a/docs/toml-schema.md b/docs/toml-schema.md index b3ef128d8..7f1f8044a 100644 --- a/docs/toml-schema.md +++ b/docs/toml-schema.md @@ -437,18 +437,18 @@ merge-queue = { # (optional - default `false`) enabled = false } -# Whether to prevent branch creation. +# Whether to prevent branch or tag creation. # (optional - default `true`) prevent-creation = true -# Whether to prevent branch deletion. +# Whether to prevent branch or tag deletion. # (optional - default `true`) prevent-deletion = true -# Whether to prevent force pushes to the branch. +# Whether to prevent force pushes to the branch or tag. # (optional - default `true`) prevent-force-push = true -# Whether to prevent updates to the branch. -# (optional - default `false`) -prevent-update = false +# Whether to prevent updates (pushes) to the branch or tag. +# (optional - default `true`) +prevent-update = true # Whether the protection applies to branches or tags. # Options are "branch" or "tag". # (optional - default `branch`) diff --git a/src/schema.rs b/src/schema.rs index 1161ae9b9..a2f2ef3bf 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -939,7 +939,7 @@ pub const fn branch_protection_default_prevent_creation() -> bool { } pub const fn branch_protection_default_prevent_update() -> bool { - false + true } pub const fn branch_protection_default_prevent_deletion() -> bool { diff --git a/tests/static-api/_expected/v1/repos.json b/tests/static-api/_expected/v1/repos.json index 8dea7a962..acee7d5b6 100644 --- a/tests/static-api/_expected/v1/repos.json +++ b/tests/static-api/_expected/v1/repos.json @@ -25,7 +25,7 @@ "allowed_merge_apps": [], "merge_queue": false, "prevent_creation": true, - "prevent_update": false, + "prevent_update": true, "prevent_deletion": true, "prevent_force_push": true } @@ -72,7 +72,7 @@ "allowed_merge_apps": [], "merge_queue": false, "prevent_creation": true, - "prevent_update": false, + "prevent_update": true, "prevent_deletion": true, "prevent_force_push": true } diff --git a/tests/static-api/_expected/v1/repos/archived_repo.json b/tests/static-api/_expected/v1/repos/archived_repo.json index 8d3e1201f..19773778d 100644 --- a/tests/static-api/_expected/v1/repos/archived_repo.json +++ b/tests/static-api/_expected/v1/repos/archived_repo.json @@ -23,7 +23,7 @@ "allowed_merge_apps": [], "merge_queue": false, "prevent_creation": true, - "prevent_update": false, + "prevent_update": true, "prevent_deletion": true, "prevent_force_push": true } diff --git a/tests/static-api/_expected/v1/repos/some_repo.json b/tests/static-api/_expected/v1/repos/some_repo.json index d5c3baab7..c74319847 100644 --- a/tests/static-api/_expected/v1/repos/some_repo.json +++ b/tests/static-api/_expected/v1/repos/some_repo.json @@ -34,7 +34,7 @@ "allowed_merge_apps": [], "merge_queue": false, "prevent_creation": true, - "prevent_update": false, + "prevent_update": true, "prevent_deletion": true, "prevent_force_push": true }