diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-01-06 17:31:56 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-06 23:46:14 +0100 |
commit | 17194b195d5db1cfd19af57e817c29bd3fa75c02 (patch) | |
tree | 848d5f854a3150f031fdb5d3b98466da09aaac8c /read-cache.c | |
parent | test-lib-functions: add helper for trailing hash (diff) | |
download | git-17194b195d5db1cfd19af57e817c29bd3fa75c02.tar.xz git-17194b195d5db1cfd19af57e817c29bd3fa75c02.zip |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c index d73a81e41a..feefa0f68b 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) |