Skip to content
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

[DRAFT] for testing : Fix 4Gb limit for large files on Git for Windows #2179

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions archive-zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static int write_zip_entry(struct archiver_args *args,
if (!buffer)
return error(_("cannot read %s"),
oid_to_hex(oid));
crc = crc32(crc, buffer, size);
crc = xcrc32(crc, buffer, size);
Copy link
Member

Choose a reason for hiding this comment

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

I think this makes sense, but the sentence "Zero length initialisations are not converted." is very cryptic.

Copy link
Author

Choose a reason for hiding this comment

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

Any better suggestions. Zero length fits into both 32bit and 64bit longs ;-)

Copy link
Member

Choose a reason for hiding this comment

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

I have no idea what you mean by that.

Copy link
Member

Choose a reason for hiding this comment

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

(That sentence makes as much sense to me as "Correct horse battery staple".)

Copy link
Author

Choose a reason for hiding this comment

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

maybe? Zero length initialisations work with both 32bit and 64bit uInt len values ;-) (only slightly less cryptic)

Otherwise it's a lot of noise changes for no benefit (there are quite a few initialisations..).

is_binary = entry_is_binary(args->repo->index,
path_without_prefix,
buffer, size);
Expand Down Expand Up @@ -428,7 +428,7 @@ static int write_zip_entry(struct archiver_args *args,
readlen = read_istream(stream, buf, sizeof(buf));
if (readlen <= 0)
break;
crc = crc32(crc, buf, readlen);
crc = xcrc32(crc, buf, readlen);
if (is_binary == -1)
is_binary = entry_is_binary(args->repo->index,
path_without_prefix,
Expand Down Expand Up @@ -461,7 +461,7 @@ static int write_zip_entry(struct archiver_args *args,
readlen = read_istream(stream, buf, sizeof(buf));
if (readlen <= 0)
break;
crc = crc32(crc, buf, readlen);
crc = xcrc32(crc, buf, readlen);
if (is_binary == -1)
is_binary = entry_is_binary(args->repo->index,
path_without_prefix,
Expand Down
2 changes: 1 addition & 1 deletion builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static void use(int bytes)
{
if (bytes > input_len)
die(_("used more bytes than were available"));
input_crc32 = crc32(input_crc32, input_buffer + input_offset, bytes);
input_crc32 = xcrc32(input_crc32, input_buffer + input_offset, bytes);
input_len -= bytes;
input_offset += bytes;

Expand Down
2 changes: 1 addition & 1 deletion csum-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void hashwrite(struct hashfile *f, const void *buf, unsigned int count)
const void *data;

if (f->do_crc)
f->crc32 = crc32(f->crc32, buf, nr);
f->crc32 = xcrc32(f->crc32, buf, nr);

if (nr == sizeof(f->buffer)) {
/* process full buffer directly without copy */
Expand Down
2 changes: 1 addition & 1 deletion pack-check.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int check_pack_crc(struct packed_git *p, struct pack_window **w_curs,
void *data = use_pack(p, w_curs, offset, &avail);
if (avail > len)
avail = len;
data_crc = crc32(data_crc, data, avail);
data_crc = xcrc32(data_crc, data, avail);
offset += avail;
len -= avail;
} while (len);
Expand Down