1
0
Fork 0

Fix missed return (#29450)

(cherry picked from commit e9f4c2db8291c54044345aebd9381ac820ed9687)
This commit is contained in:
Lunny Xiao 2024-02-27 23:09:13 +08:00 committed by Earl Warren
parent 15660334ba
commit c498c07adf
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

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