Backport #29450 by @lunny Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> (cherry picked from commit 2df38af752c13ca02a899d6a53848c68259d3336)
This commit is contained in:
parent
40c602df9b
commit
d97cd15a1b
|
@ -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 == "" {
|
||||||
|
|
Loading…
Reference in New Issue