1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Fix delete branch perm checking (#32654)

This commit is contained in:
Lunny Xiao
2024-12-03 19:59:48 -08:00
committed by GitHub
parent c9e582c6b6
commit 17053e953f
5 changed files with 130 additions and 83 deletions

View File

@@ -150,11 +150,6 @@ func DeleteBranch(ctx *context.APIContext) {
}
}
if ctx.Repo.Repository.IsMirror {
ctx.Error(http.StatusForbidden, "IsMirrored", fmt.Errorf("can not delete branch of an mirror repository"))
return
}
if err := repo_service.DeleteBranch(ctx, ctx.Doer, ctx.Repo.Repository, ctx.Repo.GitRepo, branchName); err != nil {
switch {
case git.IsErrBranchNotExist(err):