diff options
author | John Olheiser <john.olheiser@gmail.com> | 2022-09-27 17:23:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-28 00:23:58 +0200 |
commit | 8cd3237a9ef6dfa438d97c7ff2ffbd5fb8db6247 (patch) | |
tree | a14920625aff08e3bac8e001b58a087afbb1c294 /modules/structs/repo.go | |
parent | 904b324716933561028205b23ac10088f108a6de (diff) | |
download | gitea-8cd3237a9ef6dfa438d97c7ff2ffbd5fb8db6247.tar.gz gitea-8cd3237a9ef6dfa438d97c7ff2ffbd5fb8db6247.zip |
Better repo API unit checks (#21130)
This PR would presumably
Fix #20522
Fix #18773
Fix #19069
Fix #21077
Fix #13622
-----
1. Check whether unit type is currently enabled
2. Check if it _will_ be enabled via opt
3. Allow modification as necessary
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/structs/repo.go')
-rw-r--r-- | modules/structs/repo.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/structs/repo.go b/modules/structs/repo.go index d3833105d7..27e7f4618c 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -151,13 +151,13 @@ type EditRepoOption struct { Template *bool `json:"template,omitempty"` // either `true` to enable issues for this repository or `false` to disable them. HasIssues *bool `json:"has_issues,omitempty"` - // set this structure to configure internal issue tracker (requires has_issues) + // set this structure to configure internal issue tracker InternalTracker *InternalTracker `json:"internal_tracker,omitempty"` - // set this structure to use external issue tracker (requires has_issues) + // set this structure to use external issue tracker ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"` // either `true` to enable the wiki for this repository or `false` to disable it. HasWiki *bool `json:"has_wiki,omitempty"` - // set this structure to use external wiki instead of internal (requires has_wiki) + // set this structure to use external wiki instead of internal ExternalWiki *ExternalWiki `json:"external_wiki,omitempty"` // sets the default branch for this repository. DefaultBranch *string `json:"default_branch,omitempty"` @@ -165,25 +165,25 @@ type EditRepoOption struct { HasPullRequests *bool `json:"has_pull_requests,omitempty"` // either `true` to enable project unit, or `false` to disable them. HasProjects *bool `json:"has_projects,omitempty"` - // either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. `has_pull_requests` must be `true`. + // either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. IgnoreWhitespaceConflicts *bool `json:"ignore_whitespace_conflicts,omitempty"` - // either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. `has_pull_requests` must be `true`. + // either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. AllowMerge *bool `json:"allow_merge_commits,omitempty"` - // either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. `has_pull_requests` must be `true`. + // either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. AllowRebase *bool `json:"allow_rebase,omitempty"` - // either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. `has_pull_requests` must be `true`. + // either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. AllowRebaseMerge *bool `json:"allow_rebase_explicit,omitempty"` - // either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. `has_pull_requests` must be `true`. + // either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. AllowSquash *bool `json:"allow_squash_merge,omitempty"` - // either `true` to allow mark pr as merged manually, or `false` to prevent it. `has_pull_requests` must be `true`. + // either `true` to allow mark pr as merged manually, or `false` to prevent it. AllowManualMerge *bool `json:"allow_manual_merge,omitempty"` - // either `true` to enable AutodetectManualMerge, or `false` to prevent it. `has_pull_requests` must be `true`, Note: In some special cases, misjudgments can occur. + // either `true` to enable AutodetectManualMerge, or `false` to prevent it. Note: In some special cases, misjudgments can occur. AutodetectManualMerge *bool `json:"autodetect_manual_merge,omitempty"` - // either `true` to allow updating pull request branch by rebase, or `false` to prevent it. `has_pull_requests` must be `true`. + // either `true` to allow updating pull request branch by rebase, or `false` to prevent it. AllowRebaseUpdate *bool `json:"allow_rebase_update,omitempty"` // set to `true` to delete pr branch after merge by default DefaultDeleteBranchAfterMerge *bool `json:"default_delete_branch_after_merge,omitempty"` - // set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", or "squash". `has_pull_requests` must be `true`. + // set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", or "squash". DefaultMergeStyle *string `json:"default_merge_style,omitempty"` // set to `true` to archive this repository. Archived *bool `json:"archived,omitempty"` |