Browse Source

Fix missed return (#29450) (#29453)

Backport #29450 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
tags/v1.21.8
Giteabot 3 months ago
parent
commit
2df38af752
No account linked to committer's email address
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      routers/api/v1/repo/file.go

+ 1
- 0
routers/api/v1/repo/file.go View File

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

if apiOpts.BranchName == "" {

Loading…
Cancel
Save