In File Create/Update API return 404 if Branch does not exist (#11791) (#11795)

* In File Create/Update API return 404 if Branch does not exist (#11791)

* v1.12 version ;)
pull/11796/head^2
6543 5 years ago committed by GitHub
parent 99f7ec8f45
commit 20951c5c21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      routers/api/v1/repo/file.go

@ -350,6 +350,10 @@ func handleCreateOrUpdateFileError(ctx *context.APIContext, err error) {
ctx.Error(http.StatusUnprocessableEntity, "Invalid", err)
return
}
if git.IsErrBranchNotExist(err) {
ctx.Error(http.StatusNotFound, "BranchDoesNotExist", err)
return
}
ctx.Error(http.StatusInternalServerError, "UpdateFile", err)
}

Loading…
Cancel
Save