mirror of
https://github.com/go-gitea/gitea
synced 2025-11-13 01:38:12 +00:00
Remove unnecessary code and fix comments (#35761)
Follow #35459, #32562 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -243,7 +243,7 @@ func CreateBranch(ctx *context.APIContext) {
|
||||
}
|
||||
}
|
||||
|
||||
err = repo_service.CreateNewBranchFromCommit(ctx, ctx.Doer, ctx.Repo.Repository, ctx.Repo.GitRepo, oldCommit.ID.String(), opt.BranchName)
|
||||
err = repo_service.CreateNewBranchFromCommit(ctx, ctx.Doer, ctx.Repo.Repository, oldCommit.ID.String(), opt.BranchName)
|
||||
if err != nil {
|
||||
if git_model.IsErrBranchNotExist(err) {
|
||||
ctx.APIError(http.StatusNotFound, "The old branch does not exist")
|
||||
@@ -434,7 +434,7 @@ func RenameBranch(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
msg, err := repo_service.RenameBranch(ctx, repo, ctx.Doer, ctx.Repo.GitRepo, oldName, opt.Name)
|
||||
msg, err := repo_service.RenameBranch(ctx, repo, ctx.Doer, oldName, opt.Name)
|
||||
if err != nil {
|
||||
switch {
|
||||
case repo_model.IsErrUserDoesNotHaveAccessToRepo(err):
|
||||
|
||||
Reference in New Issue
Block a user