diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-07-17 00:42:46 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-17 00:42:46 (GMT) |
commit | 3b57e72c0c37b972240387cf7c4eb9d87f799c87 (patch) | |
tree | 0e44b3c4ef9a3bf077d47a94c66e9b61a763c489 /csum-file.h | |
parent | d3b88be1b450caa1244ed756c2fd7d7baadeafd8 (diff) | |
parent | f89ecf79888a48e0adf14d0e05c69ee09e853fd5 (diff) | |
download | git-3b57e72c0c37b972240387cf7c4eb9d87f799c87.zip git-3b57e72c0c37b972240387cf7c4eb9d87f799c87.tar.gz git-3b57e72c0c37b972240387cf7c4eb9d87f799c87.tar.bz2 |
Merge branch 'tb/midx-use-checksum'
When rebuilding the multi-pack index file reusing an existing one,
we used to blindly trust the existing file and ended up carrying
corrupted data into the updated file, which has been corrected.
* tb/midx-use-checksum:
midx: report checksum mismatches during 'verify'
midx: don't reuse corrupt MIDXs when writing
commit-graph: rewrite to use checksum_valid()
csum-file: introduce checksum_valid()
Diffstat (limited to 'csum-file.h')
-rw-r--r-- | csum-file.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/csum-file.h b/csum-file.h index 3044bd1..291215b 100644 --- a/csum-file.h +++ b/csum-file.h @@ -44,6 +44,9 @@ void hashflush(struct hashfile *f); void crc32_begin(struct hashfile *); uint32_t crc32_end(struct hashfile *); +/* Verify checksum validity while reading. Returns non-zero on success. */ +int hashfile_checksum_valid(const unsigned char *data, size_t len); + /* * Returns the total number of bytes fed to the hashfile so far (including ones * that have not been written out to the descriptor yet). |