mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-31 19:55:02 +00:00
Backport #40095 by @hktitof when a repository directory exists on disk without a database row, for example after a failed delete, POST /user/repos answered 500 with an empty message the migrate endpoint already answers 409 for this error and the fork API got the same treatment in https://github.com/go-gitea/gitea/pull/39909, so the create handler now maps ErrRepoFilesAlreadyExist to 409 too. this covers POST /user/repos, POST /orgs/{org}/repos and the admin user route since they all go through CreateUserRepo the integration test creates the leftover directory and asserts 409, on master it gets 500. runs on sqlite as usual this also touches routers/api/v1/repo/repo.go, which several open PRs modify, but none of them changes this error mapping Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Signed-off-by: hktitof <hktitof@users.noreply.github.com> Co-authored-by: Abdellatif Anaflous <62770500+hktitof@users.noreply.github.com> Co-authored-by: hktitof <hktitof@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>