Case insensitive branch problems #12352

Closed
opened 2025-11-02 10:06:42 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @POPSuL on GitHub (Jan 19, 2024).

Description

After upgrade from 1.20.6 to 1.21.4 we have 2 related problems.

First

On exists repository we had two different branches with same name: issue-101 and ISSUE-101. Yep, I know that is so poor, but... And on repo page we got 500 with message:
SyncRepoBranches, Error 1062 (23000): Duplicate entry '100-ISSUE-101' for key 'UQE_branch_s'.
That resolved by removing remote branch successfully.

Second

After push 2 different branches with same name to gitea it not shows on branches page, but shows on commit graph and can be viewed by direct link (screenshot below).

PoC:

git checkout -b ABC
# do some changes
git commit -am 'ABC' && git push -u origin ABC
git checkout master
git checkout -b abc
# do some changes
git commit -am 'abc' && git push -u origin abc

Probably, that can fixed by change gitea.branch.name from utf8mb4_general_ci to utf8mb_bin.

Gitea Version

1.21.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image
image

Git Version

2.27.0

Operating System

Centos 8

How are you running Gitea?

systemd unit

Database

MySQL/MariaDB

Originally created by @POPSuL on GitHub (Jan 19, 2024). ### Description After upgrade from 1.20.6 to 1.21.4 we have 2 related problems. #### First On exists repository we had two different branches with same name: `issue-101` and `ISSUE-101`. Yep, I know that is so poor, but... And on repo page we got 500 with message: `SyncRepoBranches, Error 1062 (23000): Duplicate entry '100-ISSUE-101' for key 'UQE_branch_s'`. That resolved by removing remote branch successfully. #### Second After push 2 different branches with same name to gitea it not shows on branches page, but shows on commit graph and can be viewed by direct link (screenshot below). PoC: ```sh git checkout -b ABC # do some changes git commit -am 'ABC' && git push -u origin ABC git checkout master git checkout -b abc # do some changes git commit -am 'abc' && git push -u origin abc ``` Probably, that can fixed by change gitea.branch.name from utf8mb4_general_ci to utf8mb_bin. ### Gitea Version 1.21.4 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/683358/fbc8f9d2-7ea0-43ca-b8dd-aeeac30b3734) ![image](https://github.com/go-gitea/gitea/assets/683358/e5a4ab54-606a-4e94-9cee-cd62269f51bd) ### Git Version 2.27.0 ### Operating System Centos 8 ### How are you running Gitea? systemd unit ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 10:06:42 -06:00
Author
Owner

@lunny commented on GitHub (Jan 19, 2024):

This has been resolved in 1.22 by #28662, but because of migration problem, it cannot be backport to v1.21.
You can manually change the database collation to resolve the problem.

@lunny commented on GitHub (Jan 19, 2024): This has been resolved in 1.22 by #28662, but because of migration problem, it cannot be backport to v1.21. You can manually change the database collation to resolve the problem.
Author
Owner

@POPSuL commented on GitHub (Jan 19, 2024):

Thanks!

@POPSuL commented on GitHub (Jan 19, 2024): Thanks!
Author
Owner

@github-actions[bot] commented on GitHub (Mar 1, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Mar 1, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12352