Fix missed return (#29450) (#29453)

Backport #29450 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 2df38af752c13ca02a899d6a53848c68259d3336)
This commit is contained in:
Giteabot 2024-02-27 23:33:03 +08:00 committed by Earl Warren
parent 40c602df9b
commit d97cd15a1b
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -654,6 +654,7 @@ func UpdateFile(ctx *context.APIContext) {
apiOpts := web.GetForm(ctx).(*api.UpdateFileOptions) apiOpts := web.GetForm(ctx).(*api.UpdateFileOptions)
if ctx.Repo.Repository.IsEmpty { if ctx.Repo.Repository.IsEmpty {
ctx.Error(http.StatusUnprocessableEntity, "RepoIsEmpty", fmt.Errorf("repo is empty")) ctx.Error(http.StatusUnprocessableEntity, "RepoIsEmpty", fmt.Errorf("repo is empty"))
return
} }
if apiOpts.BranchName == "" { if apiOpts.BranchName == "" {