summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2023-01-06 16:31:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-01-06 22:46:14 (GMT)
commit17194b195d5db1cfd19af57e817c29bd3fa75c02 (patch)
tree848d5f854a3150f031fdb5d3b98466da09aaac8c /read-cache.c
parentda9acde14ed4ea621b5db844630c1f620f24e110 (diff)
downloadgit-17194b195d5db1cfd19af57e817c29bd3fa75c02.zip
git-17194b195d5db1cfd19af57e817c29bd3fa75c02.tar.gz
git-17194b195d5db1cfd19af57e817c29bd3fa75c02.tar.bz2
features: feature.manyFiles implies fast index writes
The recent addition of the index.skipHash config option allows index writes to speed up by skipping the hash computation for the trailing checksum. This is particularly critical for repositories with many files at HEAD, so add this config option to two cases where users in that scenario may opt-in to such behavior: 1. The feature.manyFiles config option enables some options that are helpful for repositories with many files at HEAD. 2. 'scalar register' and 'scalar reconfigure' set config options that optimize for large repositories. In both of these cases, set index.skipHash=true to gain this speedup. Add tests that demonstrate the proper way that index.skipHash=true can override feature.manyFiles=true. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index d73a81e..feefa0f 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2927,7 +2927,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
f = hashfd(tempfile->fd, tempfile->filename.buf);
- repo_config_get_bool(r, "index.skiphash", &f->skip_hash);
+ prepare_repo_settings(r);
+ f->skip_hash = r->settings.index_skip_hash;
for (i = removed = extended = 0; i < entries; i++) {
if (cache[i]->ce_flags & CE_REMOVE)