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
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
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 == "" {