diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-01-16 12:07:47 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-01-16 12:07:47 -0800 |
| commit | ffd923868574a004ec20a80dbc3b813da9a93b08 (patch) | |
| tree | fb80c1309a6cd0528d7dcc77d20a18451ef278fc /t/test-lib-functions.sh | |
| parent | Merge branch 'ws/single-file-cone' (diff) | |
| parent | features: feature.manyFiles implies fast index writes (diff) | |
| download | git-ffd923868574a004ec20a80dbc3b813da9a93b08.tar.gz git-ffd923868574a004ec20a80dbc3b813da9a93b08.zip | |
Merge branch 'ds/omit-trailing-hash-in-index'
Introduce an optional configuration to allow the trailing hash that
protects the index file from bit flipping.
* ds/omit-trailing-hash-in-index:
features: feature.manyFiles implies fast index writes
test-lib-functions: add helper for trailing hash
read-cache: add index.skipHash config option
hashfile: allow skipping the hash function
Diffstat (limited to 't/test-lib-functions.sh')
| -rw-r--r-- | t/test-lib-functions.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 54e74d5301..1b8d4344a5 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1816,3 +1816,11 @@ test_cmp_config_output () { sort config-actual >sorted-actual && test_cmp sorted-expect sorted-actual } + +# Given a filename, extract its trailing hash as a hex string +test_trailing_hash () { + local file="$1" && + tail -c $(test_oid rawsz) "$file" | + test-tool hexdump | + sed "s/ //g" +} |
