Files
git/builtin
Johannes Schindelin 4bb086cfa2 maintenance(geometric): do release the .idx files before repacking
As is done for all the other maintenance tasks, let's release the ODB
also before starting the geometric repacking. That way, the `.idx` files
won't be `mmap()`ed when they are to be deleted (which does not work on
Windows because you cannot delete files on that platform as long as they
are kept open by a process).

This regression was introduced by 9bc151850c (builtin/maintenance:
introduce "geometric-repack" task, 2025-10-24), but was only noticed
once geometric repacking was made the default in 452b12c2e0 (builtin/
maintenance: use "geometric" strategy by default, 2026-02-24).

The fix recapitulates my work from df76ee7b77f0 (run-command: offer to
close the object store before running, 2021-09-09) & friends.

To guard against future regressions of this kind, add a check to
`run_and_verify_geometric_pack()` in `t7900` that detects orphaned
`.idx` files left behind after repacking. Contrary to interactive
calls, the `git maintenance` call in that test case would _not_ block on
Windows, asking whether to retry deleting that file, which is the reason
why this bug was not caught earlier.

Furthermore, since the default behavior of `DeleteFileW()` was changed
at some point between Windows 10 Build 17134.1304 and Build 18363.657
to use POSIX semantics (see https://stackoverflow.com/a/60512798),
the added orphaned-`.idx` check would be insufficient to catch this
regression on modern Windows without emulating legacy delete semantics
via `GIT_TEST_LEGACY_DELETE=1`.

This fixes https://github.com/git-for-windows/git/issues/6210.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-08 09:53:12 +09:00
..
2026-03-24 12:31:32 -07:00
2026-04-01 10:28:18 -07:00
2026-02-20 08:13:58 -08:00
2024-12-13 07:33:36 -08:00
2026-03-31 20:43:14 -07:00
2025-07-23 08:15:18 -07:00
2026-03-24 12:31:32 -07:00
2025-09-29 11:40:35 -07:00
2025-07-23 08:15:18 -07:00
2026-03-24 12:31:32 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2025-07-01 14:46:38 -07:00
2026-03-31 20:43:14 -07:00
2025-08-22 13:13:20 -07:00
2026-04-08 10:19:17 -07:00
2026-03-12 14:09:07 -07:00
2026-03-23 09:20:30 -07:00
2026-04-08 10:19:17 -07:00
2024-12-18 10:44:31 -08:00
2026-03-23 08:33:10 -07:00
2025-08-21 13:47:00 -07:00
2026-03-23 08:33:10 -07:00
2026-03-31 20:43:14 -07:00
2025-07-23 08:15:18 -07:00
2026-02-20 08:13:58 -08:00
2026-03-31 20:43:14 -07:00
2025-07-23 08:15:18 -07:00
2026-03-24 12:31:31 -07:00
2026-04-08 10:19:17 -07:00
2025-09-16 11:37:06 -07:00
2025-08-21 13:46:59 -07:00