[Bug] Delete Repo Fails On Windows #7335

Closed
opened 2025-11-02 07:23:15 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @kdumontnu on GitHub (May 13, 2021).

  • Gitea version (or commit ref): 1.15.0+dev-285-g6a8e5f69c
  • Git version:
  • Operating system: Windows
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
2021/05/13 13:45:45 models/admin.go:87:removeAllWithNotice() [W] Delete repository files [C:\Users\<user>\Documents\5 - Software Development\gitea\data\gitea-repositories\test\lfs_demo.git]: remove C:\Users\<user>\Documents\5 - Software Development\gitea\data\gitea-repositories\test\lfs_demo.git: The process cannot access the file because it is being used by another process.
2021/05/13 13:45:45 ...s/context/context.go:692:1() [D] Session ID: 7b2e3c9790a33b69

Description

Gitea cannot seem to delete a repo on Windows. The contents of the directory are removed, but the .git repo directory root is left behind. This results in a collision if you try to create another repo with the same name.

Appears to work fine on v1.14.

Screenshots

Says the repository was successfully deleted.
image

Collision when creating a repo with the same name
image

Originally created by @kdumontnu on GitHub (May 13, 2021). - Gitea version (or commit ref): 1.15.0+dev-285-g6a8e5f69c - Git version: - Operating system: Windows <!-- 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]`): - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [X] No - Log gist: ``` 2021/05/13 13:45:45 models/admin.go:87:removeAllWithNotice() [W] Delete repository files [C:\Users\<user>\Documents\5 - Software Development\gitea\data\gitea-repositories\test\lfs_demo.git]: remove C:\Users\<user>\Documents\5 - Software Development\gitea\data\gitea-repositories\test\lfs_demo.git: The process cannot access the file because it is being used by another process. 2021/05/13 13:45:45 ...s/context/context.go:692:1() [D] Session ID: 7b2e3c9790a33b69 ``` ## Description Gitea cannot seem to delete a repo on Windows. The contents of the directory are removed, but the .git repo directory root is left behind. This results in a collision if you try to create another repo with the same name. Appears to work fine on v1.14. ## Screenshots Says the repository was successfully deleted. ![image](https://user-images.githubusercontent.com/12700993/118185031-4d4c3280-b3f9-11eb-9b55-401f9a4f8d45.png) Collision when creating a repo with the same name ![image](https://user-images.githubusercontent.com/12700993/118185124-6654e380-b3f9-11eb-8a69-32da4f2f41b2.png)
GiteaMirror added the type/bug label 2025-11-02 07:23:15 -06:00
Author
Owner

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

it'll be due to the open git repo.

@zeripath commented on GitHub (May 13, 2021): it'll be due to the open git repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7335