Unique Constraint error when renaming a branch #12827

Closed
opened 2025-11-02 10:22:15 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @sebastian-sauer on GitHub (Apr 12, 2024).

Description

When renaming a branch to a branch name that was deleted before, a 500 error occurs with

An error occurred: RenameBranch, Error 1062 (23000): Duplicate entry '2118-Test123' for key 'UQE_branch_s'

Steps to reproduce

  • In an existing repo:
  • create a branch called Test123
  • create a second branch called Test234
  • Delete the branch Test123
  • Rename (via web ui) the branch Test234 to Test123

--> Error 500 with above mentioned error.

Gitea Version

1.21.10

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Binary from downloads

Database

None

Originally created by @sebastian-sauer on GitHub (Apr 12, 2024). ### Description When renaming a branch to a branch name that was deleted before, a 500 error occurs with `An error occurred: RenameBranch, Error 1062 (23000): Duplicate entry '2118-Test123' for key 'UQE_branch_s'` *Steps to reproduce* - In an existing repo: - create a branch called Test123 - create a second branch called Test234 - Delete the branch Test123 - Rename (via web ui) the branch Test234 to Test123 --> Error 500 with above mentioned error. ### Gitea Version 1.21.10 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Binary from downloads ### Database None
GiteaMirror added the type/bug label 2025-11-02 10:22:15 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12827