forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Support loose 4GB+ objects #6353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dscho
wants to merge
3
commits into
git-for-windows:main
Choose a base branch
from
dscho:support-loose-4gb-objects
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/bin/sh | ||
| # | ||
| # Copyright (c) 2026 Johannes Schindelin | ||
| # | ||
|
|
||
| test_description='add 4GB+ objects' | ||
|
|
||
| . ./test-lib.sh | ||
|
|
||
| if ! test_have_prereq EXPENSIVE,SIZE_T_IS_64BIT | ||
| then | ||
| skip_all='expensive 4GB blob test; enable on 64-bit with GIT_TEST_LONG=true' | ||
| test_done | ||
| fi | ||
|
|
||
| size_4gb=4294967296 | ||
|
|
||
| test_expect_success 'set up a 4GB file' ' | ||
| test_atexit "rm -f large" && | ||
| # genrandom takes only an unsigned long... | ||
| test-tool genrandom 123 $(($size_4gb-1)) >large && | ||
| printf 1 >>large | ||
| ' | ||
|
|
||
| test_expect_success 'add 4GB file' ' | ||
| git add large && | ||
| git cat-file -s :large >size-staged && | ||
| test $size_4gb = $(cat size-staged) | ||
| ' | ||
| test_expect_success 'read 4GB loose object' ' | ||
| git -P show :large >read && | ||
| test_file_size read >size-read && | ||
| test $size_4gb = $(cat size-read) | ||
| ' | ||
|
|
||
| test_done |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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_VALUEto check or gate something which now should be checking againstSIZE_MAX?There was a problem hiding this comment.
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
uLongcode) are about zlib's API using theunsigned longdata type instead of thesize_tone... So we have to work around that in Git's code. This macro is correct, and needed as-is, unfortunately.