1
1
mirror of https://github.com/go-gitea/gitea.git synced 2026-03-08 07:16:18 +01:00
gitea/routers/api/v1/repo
silverwind 761b9d439b
Fix API not persisting pull request unit config when has_pull_requests is not set (#36718)
The `PATCH /api/v1/repos/{owner}/{repo}` endpoint silently ignores pull
request config fields (like `default_delete_branch_after_merge`,
`allow_squash_merge`, etc.) unless `has_pull_requests: true` is also
included in the request body. This is because the entire PR unit config
block was gated behind `if opts.HasPullRequests != nil`.

This PR restructures the logic so that PR config options are applied
whenever the pull request unit already exists on the repo, without
requiring `has_pull_requests` to be explicitly set. A new unit is only
created when `has_pull_requests: true` is explicitly sent.

Fixes https://github.com/go-gitea/gitea/issues/36466
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2026-03-02 22:08:53 +00:00
..
action.go feat: Add Actions API rerun endpoints for runs and jobs (#36768) 2026-03-02 21:34:06 +00:00
actions_run.go Add owner and parent fields clarification to docs (#35023) 2025-07-23 06:44:34 +00:00
avatar.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
blob.go Refactor repo contents API and add "contents-ext" API (#34822) 2025-06-25 02:34:21 +00:00
branch.go Delete non-exist branch should return 404 (#36694) 2026-03-02 11:08:16 -08:00
collaborators.go Enable gocritic equalFold and fix issues (#34952) 2025-07-06 16:53:34 +00:00
commits.go Move commit related functions to gitrepo package (#35600) 2025-12-05 00:20:23 +00:00
compare.go Refactor compare router param parse (#36105) 2025-12-25 17:51:30 -08:00
download.go Add ability to download subpath archive (#36371) 2026-01-16 09:31:12 +00:00
file.go Refactor avatar package, support default avatar fallback (#36788) 2026-03-01 13:32:35 +00:00
fork.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
git_hook.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
git_ref.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
hook_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
hook.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
issue_attachment.go fix attachment file size limit in server backend (#35519) 2025-10-21 15:07:11 +00:00
issue_comment_attachment.go fix attachment file size limit in server backend (#35519) 2025-10-21 15:07:11 +00:00
issue_comment.go Add resolve/unresolve review comment API endpoints (#36441) 2026-02-01 12:28:28 +00:00
issue_dependency.go Add paging headers (#36521) 2026-02-06 13:12:05 +00:00
issue_label.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
issue_lock.go Add API routes to lock and unlock issues (#34165) 2025-04-21 00:43:43 +00:00
issue_pin.go Address some CodeQL security concerns (#35572) 2025-10-04 01:21:26 +08:00
issue_reaction.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
issue_stopwatch.go Add more check for stopwatch read or list (#36340) 2026-01-13 13:13:39 +00:00
issue_subscription.go Add a login/login-name/username disambiguation to affected endpoint parameters and response/request models (#34901) 2025-06-29 21:17:45 -07:00
issue_tracked_time.go Fix track time issue id (#36664) 2026-02-20 21:48:54 +00:00
issue.go Add created_by filter to SearchIssues (#36670) 2026-02-26 11:56:02 +00:00
key.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
label.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
language.go Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
license.go Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
migrate.go Unify repo names in system notices (#36491) 2026-02-01 17:06:57 +08:00
milestone.go refactor: extract helper functions from SearchIssues (#36158) 2025-12-20 17:57:41 -08:00
mirror.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
notes.go Improve "not found" error messages for API (#34267) 2025-04-23 17:42:50 +08:00
patch.go Fix diffpatch API endpoint (#35610) 2025-10-10 00:39:14 +08:00
pull_review.go Add resolve/unresolve review comment API endpoints (#36441) 2026-02-01 12:28:28 +00:00
pull.go Allow configuring default PR base branch (fixes #36412) (#36425) 2026-02-07 01:34:29 +00:00
release_attachment.go Fix release draft access check logic (#36720) 2026-02-25 20:59:29 +00:00
release_tags.go Fix various permission & login related bugs (#36002) 2025-11-22 07:16:08 +00:00
release.go Fix release draft access check logic (#36720) 2026-02-25 20:59:29 +00:00
repo_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
repo.go Fix API not persisting pull request unit config when has_pull_requests is not set (#36718) 2026-03-02 22:08:53 +00:00
star.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
status.go Add paging headers (#36521) 2026-02-06 13:12:05 +00:00
subscriber.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
tag.go Improve "not found" error messages for API (#34267) 2025-04-23 17:42:50 +08:00
teams.go Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
topic.go Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
transfer.go Fix return bug (#34093) 2025-04-01 17:36:46 -04:00
tree.go Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
wiki.go Add paging headers (#36521) 2026-02-06 13:12:05 +00:00