gitea/services/context
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
..
upload Edit file workflow for creating a fork and proposing changes (#34240) 2025-06-22 12:43:43 +00:00
access_log_test.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
access_log.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
api_org.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
api_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
api.go Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
base_form.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
base_path.go Clarify path param naming (#32969) 2024-12-24 13:47:45 +00:00
base_test.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
base.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
captcha.go Refactor template & test related code (#32938) 2024-12-22 15:33:19 +00:00
context_cookie.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
context_model.go Refactor context repository (#33202) 2025-01-12 03:39:46 +00:00
context_request.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
context_response.go Do not show 500 error when default branch doesn't exist (#34096) 2025-04-01 21:39:00 -07:00
context_template.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
context_test.go Refactor request context (#32956) 2024-12-24 11:43:57 +08:00
context.go Add endpoint deleting workflow run (#34337) 2025-05-13 19:18:13 +00:00
csrf.go Refactor CSRF token (#32216) 2024-10-10 03:48:21 +00:00
org.go Fix team permission (#34128) 2025-04-08 04:15:15 +00:00
package.go Add a config option to block "expensive" pages for anonymous users (#34024) 2025-03-30 05:26:19 +00:00
pagination.go Only use prev and next buttons for pagination on user dashboard (#33981) 2025-03-23 19:52:43 +00:00
permission.go Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
private.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
repo.go Edit file workflow for creating a fork and proposing changes (#34240) 2025-06-22 12:43:43 +00:00
response.go Remove duplicate "ResponseWriter.Status" method (#33346) 2025-01-22 06:37:52 +00:00
user.go Refactor error system (#33626) 2025-02-17 12:41:03 -08:00
utils.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
xsrf_test.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
xsrf.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00