Skip to content

Support loose 4GB+ objects - #6353

Open
dscho wants to merge 3 commits into
git-for-windows:mainfrom
dscho:support-loose-4gb-objects
Open

Support loose 4GB+ objects#6353
dscho wants to merge 3 commits into
git-for-windows:mainfrom
dscho:support-loose-4gb-objects

Conversation

@dscho

@dscho dscho commented Jul 30, 2026

Copy link
Copy Markdown
Member

When I merged the massive amount of work in #6289, I thought that that was the end of it. But simply staging and unpacking loose blobs that are 4GB or larger still does not work. This PR addresses that.

This fixes #6012

dscho added 3 commits July 30, 2026 14:19
This is yet another set of `unsigned long` declarations that should have
been `size_t` ones.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
... and yet another round of `unsigned long` -> `size_t`
transmogrifications.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
I should have added this test as soon as
git-for-windows#6012 was opened.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Jul 30, 2026
@dscho
dscho requested review from mjcheetham and rimrul July 30, 2026 21:38
Comment thread git-zlib.c
@@ -33,7 +33,7 @@ static const char *zerr_to_string(int status)

/* uLong is 32-bit on Windows, even on 64-bit systems */
#define ULONG_MAX_VALUE maximum_unsigned_value_of_type(uLong)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This macro and comment makes me wonder if we're not using the ULONG_MAX_VALUE to check or gate something which now should be checking against SIZE_MAX?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this macro (and the surrounding uLong code) are about zlib's API using the unsigned long data type instead of the size_t one... So we have to work around that in Git's code. This macro is correct, and needed as-is, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Warning Leads to Silent Data Loss When Committing Large Files (>4GB)

2 participants