summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2023-01-06 16:31:55 +0000
committerJunio C Hamano <gitster@pobox.com>2023-01-07 07:46:14 +0900
commitda9acde14ed4ea621b5db844630c1f620f24e110 (patch)
tree5fd0a2e5efccb1cc91bff329ed10ed06b1a34df4 /read-cache.c
parentee1f0c242efc022c185e9be9f672289d5420a664 (diff)
downloadgit-da9acde14ed4ea621b5db844630c1f620f24e110.tar.gz
test-lib-functions: add helper for trailing hash
It can be helpful to check that a file format with a trailing hash has a specific hash in the final bytes of a written file. This is made more apparent by recent changes that allow skipping the hash algorithm and writing a null hash at the end of the file instead. Add a new test_trailing_hash helper and use it in t1600 to verify that index.skipHash=true really does skip the hash computation, since 'git fsck' does not actually verify the hash. This confirms that when the config is disabled explicitly in a super project but enabled in a submodule, then the use of repo_config_get_bool() loads config from the correct repository in the case of 'git add'. There are other cases where istate->repo is NULL and thus this config is loaded instead from the_repository, but that's due to many different code paths initializing index_state structs in their own way. Keep the 'git fsck' call to ensure that any potential future change to check the index hash does not cause an error in this case. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
0 files changed, 0 insertions, 0 deletions