Open mateuszkuta256 opened 2 weeks ago
- gc will remove garbage .pack even if the corresponding index is missing or
Hmm. That might be possible. But. The idea is that packfiles are indexed while they are downloaded, and as long as there is no .idx
file they are not considered to be active. You may very well delete (on platforms where files can be deleted while they are being written to) an in-progress packfile.
- git will never remove .idx if the corresponding .pack is locked
This might be the easier variant: You would need to replace this call:
string_list_sort(&names);
by a call to qsort()
using a compare function that would sort .idx
files after their corresponding .pack
files.
Setup
Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
Details
Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
What commands did you run to trigger this issue?
$ git gc
if there's another git process running, it may ask:
select n
$ git count-objects -v
will display:This is expected, but if you terminate the other git process and run gc again, it won't remove .pack that corresponds to the missing index. The only way to get rid of it is to recreate the index (index-pack) before the next gc
What did you expect to occur after running these commands?
OR
What actually happened instead? .idx was removed and orphaned .pack, which will be ignored in subsequent gc