From 3d6cb25e315c0d4249c5c749a2eb8c64ec463aad Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sat, 11 Sep 2021 16:21:17 +0200 Subject: Support unprotected file patterns (#16395) Fixes #16381 Note that changes to unprotected files via the web editor still cannot be pushed directly to the protected branch. I could easily add such support for edits and deletes if needed. But for adding, uploading or renaming unprotected files, it is not trivial. * Extract & Move GetAffectedFiles to modules/git --- modules/structs/repo_branch.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/structs/repo_branch.go') diff --git a/modules/structs/repo_branch.go b/modules/structs/repo_branch.go index efb4caecb0..1f3bc04e86 100644 --- a/modules/structs/repo_branch.go +++ b/modules/structs/repo_branch.go @@ -44,6 +44,7 @@ type BranchProtection struct { DismissStaleApprovals bool `json:"dismiss_stale_approvals"` RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` + UnprotectedFilePatterns string `json:"unprotected_file_patterns"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time @@ -73,6 +74,7 @@ type CreateBranchProtectionOption struct { DismissStaleApprovals bool `json:"dismiss_stale_approvals"` RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` + UnprotectedFilePatterns string `json:"unprotected_file_patterns"` } // EditBranchProtectionOption options for editing a branch protection @@ -97,4 +99,5 @@ type EditBranchProtectionOption struct { DismissStaleApprovals *bool `json:"dismiss_stale_approvals"` RequireSignedCommits *bool `json:"require_signed_commits"` ProtectedFilePatterns *string `json:"protected_file_patterns"` + UnprotectedFilePatterns *string `json:"unprotected_file_patterns"` } -- cgit v1.2.3