Merge branch 'mc/clean-smudge-with-llp64'
The clean/smudge conversion code path has been prepared to better work on platforms where ulong is narrower than size_t. * mc/clean-smudge-with-llp64: clean/smudge: allow clean filters to process extremely large files odb: guard against data loss checking out a huge file git-compat-util: introduce more size_t helpers odb: teach read_blob_entry to use size_t t1051: introduce a smudge filter test for extremely large files test-lib: add prerequisite for 64-bit platforms test-tool genzeros: generate large amounts of data more efficiently test-genzeros: allow more than 2G zeros in Windows
This commit is contained in:
@ -1306,7 +1306,7 @@ static void *unpack_loose_rest(git_zstream *stream,
|
||||
int parse_loose_header(const char *hdr, struct object_info *oi)
|
||||
{
|
||||
const char *type_buf = hdr;
|
||||
unsigned long size;
|
||||
size_t size;
|
||||
int type, type_len = 0;
|
||||
|
||||
/*
|
||||
@ -1341,12 +1341,12 @@ int parse_loose_header(const char *hdr, struct object_info *oi)
|
||||
if (c > 9)
|
||||
break;
|
||||
hdr++;
|
||||
size = size * 10 + c;
|
||||
size = st_add(st_mult(size, 10), c);
|
||||
}
|
||||
}
|
||||
|
||||
if (oi->sizep)
|
||||
*oi->sizep = size;
|
||||
*oi->sizep = cast_size_t_to_ulong(size);
|
||||
|
||||
/*
|
||||
* The length must be followed by a zero byte
|
||||
|
Reference in New Issue
Block a user