forgejo/tests
oliverpool c93eb1f927 API: enforce sha requirement on POST /repos/{owner}/{repo}/contents (#8139)
Currently the `POST /repos/{owner}/{repo}/contents` API endpoint accepts request without any `ChangeFileOperation.SHA`, unlike stated by the doc:
33eee199cf/modules/structs/repo_file.go (L80-L81)

This PR adds:
- some more (already passing) tests around this function
- a new (failing) test to show this wrong behavior
- a fix (note that this is a breaking change for clients exploiting this bug)
- an update for all the existing tests

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Breaking bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/8139): <!--number 8139 --><!--line 0 --><!--description QVBJOiBlbmZvcmNlIHNoYSByZXF1aXJlbWVudCBvbiBgUE9TVCAvcmVwb3Mve293bmVyfS97cmVwb30vY29udGVudHNg-->API: enforce sha requirement on `POST /repos/{owner}/{repo}/contents`<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8139
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-06-12 00:13:39 +02:00
..
e2e API: enforce sha requirement on POST /repos/{owner}/{repo}/contents (#8139) 2025-06-12 00:13:39 +02:00
fuzz chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
gitea-lfs-meta Test views of LFS files (#22196) 2022-12-23 07:41:56 +08:00
gitea-repositories-meta feat: make action runs available in api (#7699) 2025-06-02 22:05:12 +02:00
integration API: enforce sha requirement on POST /repos/{owner}/{repo}/contents (#8139) 2025-06-12 00:13:39 +02:00
testdata/data Add artifacts test fixture (#30300) 2024-11-05 09:33:15 +01:00
mysql.ini.tmpl feat: remove API authentication methods that uses the URL query (#7924) 2025-05-23 22:47:43 +02:00
pgsql.ini.tmpl feat: remove API authentication methods that uses the URL query (#7924) 2025-05-23 22:47:43 +02:00
sqlite.ini.tmpl feat: remove API authentication methods that uses the URL query (#7924) 2025-05-23 22:47:43 +02:00
test_utils.go API: enforce sha requirement on POST /repos/{owner}/{repo}/contents (#8139) 2025-06-12 00:13:39 +02:00