Incosistency when Repo already exists between create/migrate #3049

Closed
opened 2025-11-02 04:58:55 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @bogdanpetrea on GitHub (Mar 14, 2019).

  • Gitea version (or commit ref): d7542bfde3
  • Git version: 1.7.4
  • Operating system: any
  • Database: any
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

There is an incosistency between handling an RepoAlreadyExists error between migrating a repo and creating a fresh one:

I think the migrating repo error response (409 Conflict, The repository with the same name already exists.) should be used in both cases.

Originally created by @bogdanpetrea on GitHub (Mar 14, 2019). - Gitea version (or commit ref): https://github.com/go-gitea/gitea/commit/d7542bfde3e46b5b11d2296e69f86a0e32ce9565 - Git version: 1.7.4 - Operating system: any - Database: any - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description There is an incosistency between handling an RepoAlreadyExists error between migrating a repo and creating a fresh one: - [migrating repo](https://github.com/go-gitea/gitea/blob/7afe81f28e530c1c5aed1583654b3d772c368fa5/routers/api/v1/repo/repo.go#L412) - [creating fresh repo](https://github.com/go-gitea/gitea/blob/7afe81f28e530c1c5aed1583654b3d772c368fa5/routers/api/v1/repo/repo.go#L232) I think the migrating repo error response (`409 Conflict`, `The repository with the same name already exists.`) should be used in both cases.
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 04:58:55 -06:00
Author
Owner

@wkulhanek commented on GitHub (Oct 15, 2020):

This 409 is not documented on the /api/swagger. Could it be added, please?

@wkulhanek commented on GitHub (Oct 15, 2020): This 409 is not documented on the /api/swagger. Could it be added, please?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3049