gitea/models
Brecht Van Lommel a46b16f10f
Edit file workflow for creating a fork and proposing changes (#34240)
When viewing a file that the user can't edit because they can't write to
the branch, the new, upload, patch, edit and delete functionality is no
longer disabled.

If no user fork of the repository exists, there is now a page to create one.
It will automatically create a fork with a single branch matching the one
being viewed, and a unique repository name will be automatically picked.

When a fork exists, but it's archived, a mirror or the user can't write
code to it, there will instead be a message explaining the situation.

If the usable fork exists, a message will appear at the top of the edit page
explaining that the changes will be applied to a branch in the fork. The
base repository branch will be pushed to a new branch to the fork, and
then the edits will be applied on top.

The suggestion to fork happens when accessing /_edit/, so that for
example online documentation can have an "edit this page" link to
the base repository that does the right thing.

Also includes changes to properly report errors when trying to commit
to a new branch that is protected, and when trying to commit to an
existing branch when choosing the new branch option.

Resolves #9017, #20882

---------

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-22 12:43:43 +00:00
..
actions Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
activities Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
admin Fix omitempty bug (#33663) 2025-02-20 12:39:21 -08:00
asymkey Update x/crypto package and make builtin SSH use default parameters (#34667) 2025-06-09 19:51:02 +00:00
auth Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
avatars Replace 10 more gt- classes with tw- (#29945) 2024-03-22 13:45:10 +00:00
db Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
dbfs Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
fixtures Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
git Refactor editor (#34780) 2025-06-21 19:20:51 +08:00
issues Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
migrations Upgrade gopls to v0.19.0, add make fix (#34772) 2025-06-18 19:30:40 +00:00
organization Refactor FindOrgOptions to use enum instead of bool, fix membership visibility (#34629) 2025-06-09 03:30:34 +00:00
packages Fix some package registry problems (#34759) 2025-06-19 00:32:43 +08:00
perm Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
project Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
pull Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
renderhelper Fix commit message rendering and some UI problems (#34680) 2025-06-10 23:20:32 +08:00
repo Edit file workflow for creating a fork and proposing changes (#34240) 2025-06-22 12:43:43 +00:00
secret Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +00:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
system Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
unit Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
unittest Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
user Add post-installation redirect based on admin account status (#34493) 2025-06-21 18:48:06 +00:00
webhook Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
repo_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
repo.go Fix issue comment number (#30556) 2024-12-30 14:35:46 -08:00