Skip to content

Commit da657a7

Browse files
dschoGit for Windows Build Agent
authored andcommitted
maintenance(geometric): avoid deadlocks on Windows 10 (#6215)
This PR is a companion of gitgitgadget#2103. On Windows, `maintenance_task_geometric_repack()` opens pack index files via `pack_geometry_init()` (which `mmap()`s the `.idx` files), then spawns `git repack` as a child process without setting `child.odb_to_close`. The parent's `mmap()`s prevent the child from deleting old `.idx` files. On Windows 10 builds before the POSIX delete semantics change (between Build 17134.1304 and 18363.657, see https://stackoverflow.com/a/60512798), this results in `Unlink of file '.git/objects/pack/pack-<hash>.idx' failed. Should I try again?` during fetch-triggered auto-maintenance with the geometric strategy. The fix adds the missing `child.odb_to_close = the_repository->objects` line, matching all other maintenance tasks. The first commit introduces a `GIT_TEST_LEGACY_DELETE` environment variable to simulate legacy (pre-POSIX) delete semantics on modern Windows, so the regression test can verify the fix even on Windows 11. This fixes #6210. Tested-by: Patryk Miś <foss@patrykmis.com>
2 parents 53d2a7a + 12ebd5c commit da657a7

0 file changed

File tree

    0 commit comments

    Comments
     (0)