Files
git/lib
Derrick Stolee 99eadc0d87 unpack-trees: enable fscache for sparse-checkout
When updating the skip-worktree bits in the index to align with new
values in a sparse-checkout file, Git scans the entire working
directory with lstat() calls. In a sparse-checkout, many of these
lstat() calls are for paths that do not exist.

Enable the fscache feature during this scan. Since enable_fscache()
calls nest, the disable_fscache() method decrements a counter and
would only clear the cache if that counter reaches zero.

In a local test of a repo with ~2.2 million paths, updating the index
with git read-tree -m -u HEAD with a sparse-checkout file containing
only /.gitattributes improved from 2-3 minutes to ~6 seconds.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2026-06-26 08:58:04 +00:00
..
2026-06-26 08:57:54 +00:00
2026-06-26 08:58:02 +00:00
2026-06-26 08:57:53 +00:00
2026-06-26 08:58:03 +00:00