Fix missed return (#29450) (#29453)

Backport #29450 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
pull/29469/head
Giteabot 9 months ago committed by GitHub
parent dc48eb070b
commit 2df38af752
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      routers/api/v1/repo/file.go

@ -649,6 +649,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 == "" {

Loading…
Cancel
Save