mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-22 04:38:17 +08:00
Refactor ref type (#33242)
Major changes: 1. do not sync ".keep" file during tests 2. fix incorrect route handler and empty repo handling (backported as #33253 with tests) 3. do not use `RepoRef`: most of the calls are abuses. 4. Use `git.RefType` instead of a new type definition `RepoRefType` on `context`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -21,8 +21,8 @@ func RequireRepoAdmin() func(ctx *Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// CanEnableEditor checks if the user is allowed to write to the branch of the repo
|
||||
func CanEnableEditor() func(ctx *Context) {
|
||||
// CanWriteToBranch checks if the user is allowed to write to the branch of the repo
|
||||
func CanWriteToBranch() func(ctx *Context) {
|
||||
return func(ctx *Context) {
|
||||
if !ctx.Repo.CanWriteToBranch(ctx, ctx.Doer, ctx.Repo.BranchName) {
|
||||
ctx.NotFound("CanWriteToBranch denies permission", nil)
|
||||
|
Reference in New Issue
Block a user