]> git.99rst.org Git - git.git/commit
hash-object: demonstrate a >4GB/LLP64 problem
authorPhilip Oakley <redacted>
Tue, 16 Jun 2026 14:49:52 +0000 (14:49 +0000)
committerJunio C Hamano <redacted>
Tue, 16 Jun 2026 16:02:32 +0000 (09:02 -0700)
commitd1b74b6b988e71d78d05a3fd6f186025e3f692ba
tree3e048c47a8489c8f0ca004b7aefcfdc857aadf0d
parent700432b2ba22603a0bcb71475c9c333d17c9b0d1
hash-object: demonstrate a >4GB/LLP64 problem

On LLP64 systems, such as Windows, the size of `long`, `int`, etc. is
only 32 bits (for backward compatibility). Git's use of `unsigned long`
for file memory sizes in many places, rather than size_t, limits the
handling of large files on LLP64 systems (commonly given as `>4GB`).

Provide a minimum test for handling a >4GB file. The `hash-object`
command, with the  `--literally` and without `-w` option avoids
writing the object, either loose or packed. This avoids the code paths
hitting the `bigFileThreshold` config test code, the zlib code, and the
pack code.

Subsequent patches will walk the test's call chain, converting types to
`size_t` (which is larger in LLP64 data models) where appropriate.

Signed-off-by: Philip Oakley <redacted>
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
t/t1007-hash-object.sh
git clone https://git.99rst.org/PROJECT