]> git.ipfire.org Git - thirdparty/git.git/commit
object-file.c: use size_t for header lengths
authorPhilip Oakley <philipoakley@iee.email>
Tue, 16 Jun 2026 14:49:53 +0000 (14:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jun 2026 16:02:32 +0000 (09:02 -0700)
commita39fda4fca37c1b8700ccfe0f9d0194445373b97
treec34499cd6e441727609c7466a68fdfe2f0c4b756
parentd1b74b6b988e71d78d05a3fd6f186025e3f692ba
object-file.c: use size_t for header lengths

Continue walking the code path for the >4GB `hash-object --literally`
test. The `hash_object_file_literally()` function internally uses both
`hash_object_file()` and `write_object_file_prepare()`. Both function
signatures use `unsigned long` rather than `size_t` for the mem buffer
sizes. Use `size_t` instead, for LLP64 compatibility.

While at it, convert those function's object's header buffer length to
`size_t` for consistency. The value is already upcast to `uintmax_t` for
print format compatibility.

Note: The hash-object test still does not pass. A subsequent commit
continues to walk the call tree's lower level hash functions to identify
further fixes.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c
object-file.h
odb/source-files.c
odb/source-inmemory.c
odb/source-loose.c
odb/source.h