Merge branch 'nd/pack-ofs-4gb-limit'
"git pack-objects" and "git index-pack" mostly operate with off_t when talking about the offset of objects in a packfile, but there were a handful of places that used "unsigned long" to hold that value, leading to an unintended truncation. * nd/pack-ofs-4gb-limit: fsck: use streaming interface for large blobs in pack pack-objects: do not truncate result in-pack object size on 32-bit systems index-pack: correct "offset" type in unpack_entry_data() index-pack: report correct bad object offsets even if they are large index-pack: correct "len" type in unpack_data() sha1_file.c: use type off_t* for object_info->disk_sizep pack-objects: pass length to check_pack_crc() without truncation
This commit is contained in:
@ -131,7 +131,7 @@ struct expand_data {
|
||||
unsigned char sha1[20];
|
||||
enum object_type type;
|
||||
unsigned long size;
|
||||
unsigned long disk_size;
|
||||
off_t disk_size;
|
||||
const char *rest;
|
||||
unsigned char delta_base_sha1[20];
|
||||
|
||||
@ -191,7 +191,7 @@ static void expand_atom(struct strbuf *sb, const char *atom, int len,
|
||||
if (data->mark_query)
|
||||
data->info.disk_sizep = &data->disk_size;
|
||||
else
|
||||
strbuf_addf(sb, "%lu", data->disk_size);
|
||||
strbuf_addf(sb, "%"PRIuMAX, (uintmax_t)data->disk_size);
|
||||
} else if (is_atom("rest", atom, len)) {
|
||||
if (data->mark_query)
|
||||
data->split_on_whitespace = 1;
|
||||
|
Reference in New Issue
Block a user