mirror of
https://github.com/go-gitea/gitea
synced 2024-12-25 19:04:31 +01:00
In File Create/Update API return 404 if Branch does not exist (#11791)
This commit is contained in:
parent
3f3a081758
commit
479ef5c379
1 changed files with 4 additions and 0 deletions
|
@ -350,6 +350,10 @@ func handleCreateOrUpdateFileError(ctx *context.APIContext, err error) {
|
|||
ctx.Error(http.StatusUnprocessableEntity, "Invalid", err)
|
||||
return
|
||||
}
|
||||
if models.IsErrBranchDoesNotExist(err) || git.IsErrBranchNotExist(err) {
|
||||
ctx.Error(http.StatusNotFound, "BranchDoesNotExist", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Error(http.StatusInternalServerError, "UpdateFile", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue