1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-13 13:08:19 +00:00

Add has_code to repository REST API (#35214)

similar to how we can enable/disable repos or issues on a repo add the
code unit as option to it.

affects

```
PATCH /repos/{owner}/{repo}
```

---
*Sponsored by Kithara Software GmbH*
This commit is contained in:
6543
2025-08-08 18:18:30 +02:00
committed by GitHub
parent 793815adf7
commit ef613ee760
4 changed files with 78 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ type Repository struct {
Updated time.Time `json:"updated_at"`
ArchivedAt time.Time `json:"archived_at"`
Permissions *Permission `json:"permissions,omitempty"`
HasCode bool `json:"has_code"`
HasIssues bool `json:"has_issues"`
InternalTracker *InternalTracker `json:"internal_tracker,omitempty"`
ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"`
@@ -170,6 +171,8 @@ type EditRepoOption struct {
Private *bool `json:"private,omitempty"`
// either `true` to make this repository a template or `false` to make it a normal repository
Template *bool `json:"template,omitempty"`
// either `true` to enable code for this repository or `false` to disable it.
HasCode *bool `json:"has_code,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