gitea/tests
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
..
e2e Rework e2e tests (#36634) 2026-02-20 16:26:47 -08:00
fuzz Fix fuzz test (#33156) 2025-01-09 15:15:47 +08:00
gitea-lfs-meta
gitea-repositories-meta Fix corrupted external render content (#35946) 2025-11-14 08:31:11 +08:00
integration Fix API not persisting pull request unit config when has_pull_requests is not set (#36718) 2026-03-02 22:08:53 +00:00
testdata/data Add artifacts test fixture (#30300) 2024-11-01 10:29:54 +08:00
mssql.ini.tmpl Use "Enable Gravatar" but not "Disable" (#36771) 2026-02-27 16:39:26 +00:00
mysql.ini.tmpl Use "Enable Gravatar" but not "Disable" (#36771) 2026-02-27 16:39:26 +00:00
pgsql.ini.tmpl Use "Enable Gravatar" but not "Disable" (#36771) 2026-02-27 16:39:26 +00:00
sqlite.ini.tmpl Use "Enable Gravatar" but not "Disable" (#36771) 2026-02-27 16:39:26 +00:00
test_utils.go Clean up Makefile, tests and legacy code (#36638) 2026-02-19 01:23:32 +00:00