fix(web): populate the reason for "cannot commit to branch" in web editor commit form - #39155
Merged
bircni merged 8 commits intoAug 28, 2026
Merged
Conversation
Fixes go-gitea#38710. When a user edits via fork (code:read on upstream), the disabled direct-commit option showed an empty reason list because the template only checked push permission on the fork. PrepareCommitFormOptions now builds CannotCommitReasons on the backend and the template renders them.
Contributor
|
The logic should be exactly the same as |
wxiaoguang
marked this pull request as draft
August 27, 2026 14:01
wxiaoguang
marked this pull request as ready for review
August 28, 2026 11:14
wxiaoguang
approved these changes
Aug 28, 2026
bircni
approved these changes
Aug 28, 2026
bircni
enabled auto-merge (squash)
August 28, 2026 20:57
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Aug 29, 2026
* 'main' of https://github.com/go-gitea/gitea: feat(web): Add org removal functionality to admin user details page (go-gitea#38013) fix(actions): run every due schedule exactly once per occurrence (go-gitea#39078) refactor: pagination/pager (go-gitea#39162) [skip ci] Updated translations via Crowdin enhance(actions): make workflow dispatch choice dropdown support search (go-gitea#39154) fix(web): populate the reason for "cannot commit to branch" in web editor commit form (go-gitea#39155) refactor(automerge): fix error handling, populate recent automerge tasks on restart (go-gitea#39001) chore(frontend): avoid loading CSS twice in vite dev mode (go-gitea#39160)
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Aug 29, 2026
* main: feat(web): Add org removal functionality to admin user details page (go-gitea#38013) fix(actions): run every due schedule exactly once per occurrence (go-gitea#39078) refactor: pagination/pager (go-gitea#39162) [skip ci] Updated translations via Crowdin enhance(actions): make workflow dispatch choice dropdown support search (go-gitea#39154) fix(web): populate the reason for "cannot commit to branch" in web editor commit form (go-gitea#39155) refactor(automerge): fix error handling, populate recent automerge tasks on restart (go-gitea#39001) chore(frontend): avoid loading CSS twice in vite dev mode (go-gitea#39160)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #38710.
PrepareCommitFormOptionsnow buildsDenyCommitToBranchReasonon the backend, the template renders it.By the way, refactor some
CanContentChangerelated legacy code