Repositories w/ capital letters in their names show up as unadopted #7304

Closed
opened 2025-11-02 07:22:30 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @emichael on GitHub (May 6, 2021).

  • Gitea version (or commit ref): 1.14.1 (Docker)
  • Git version: N/A
  • Operating system: N/A
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
      I don't have admin access on that instance.
  • Log gist: Nothing in logs

Description

  1. Create a repository through the web interface with capital letters in its name.
  2. Go to the admin interface, Repositories, Unadopted Repositories, Search
  3. That repository will show up in the list, even though it's already imported into Gitea.

Screenshots

image
image

Originally created by @emichael on GitHub (May 6, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.1 (Docker) - Git version: N/A - Operating system: N/A <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No I don't have admin access on that instance. - Log gist: Nothing in logs <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description <!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. --> 1. Create a repository through the web interface with capital letters in its name. 2. Go to the admin interface, Repositories, Unadopted Repositories, Search 3. That repository will show up in the list, even though it's already imported into Gitea. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![image](https://user-images.githubusercontent.com/1312141/117368455-69d7f000-ae78-11eb-8e9e-a89208ec28c5.png) ![image](https://user-images.githubusercontent.com/1312141/117368560-8b38dc00-ae78-11eb-8d64-5394d7c3a898.png)
GiteaMirror added the type/bug label 2025-11-02 07:22:30 -06:00
Author
Owner

@zeripath commented on GitHub (May 6, 2021):

Gitea does not create repositories with capital names, non bare or repositories without the .git suffix. It can only adopt repositories that look like they were made by it.

If we adopted repositories that did not meet those requirements there would be multiple issues.

The rules for adoption are strict and necessarily so.

@zeripath commented on GitHub (May 6, 2021): Gitea does not create repositories with capital names, non bare or repositories without the .git suffix. It can only adopt repositories that look like they were made by it. If we adopted repositories that did not meet those requirements there would be multiple issues. The rules for adoption are strict and necessarily so.
Author
Owner

@zeripath commented on GitHub (May 6, 2021):

Oh sorry I got the wrong end of the stick here!

@zeripath commented on GitHub (May 6, 2021): Oh sorry I got the wrong end of the stick here!
Author
Owner

@emichael commented on GitHub (May 6, 2021):

It's very likely just a missing toLower() or some such function when matching existing repo names in Gitea against filesystem names. Probably a one line fix.

@emichael commented on GitHub (May 6, 2021): It's very likely just a missing `toLower()` or some such function when matching existing repo names in Gitea against filesystem names. Probably a one line fix.
Author
Owner

@zeripath commented on GitHub (May 6, 2021):

The bug is here:

https://github.com/go-gitea/gitea/blob/ab77a24f18ae45248bd6c71778fe3bfacacf864f/modules/repository/adopt.go#L231

Which should be repo.LowerName not repo.Name

@zeripath commented on GitHub (May 6, 2021): The bug is here: https://github.com/go-gitea/gitea/blob/ab77a24f18ae45248bd6c71778fe3bfacacf864f/modules/repository/adopt.go#L231 Which should be repo.LowerName not repo.Name
Author
Owner

@zeripath commented on GitHub (May 6, 2021):

Feel free to put up a PR. The rest of the code is doing the correct thing - that one sneaked through by accident.

@zeripath commented on GitHub (May 6, 2021): Feel free to put up a PR. The rest of the code is doing the correct thing - that one sneaked through by accident.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7304