pack-objects: use bitfield for object_entry::depth
Because of struct packing from now on we can only handle max depth 4095 (or even lower when new booleans are added in this struct). This should be ok since long delta chain will cause significant slow down anyway. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
0c6804ab4e
commit
b5c0cbd808
@ -3068,6 +3068,12 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
||||
if (pack_to_stdout != !base_name || argc)
|
||||
usage_with_options(pack_usage, pack_objects_options);
|
||||
|
||||
if (depth >= (1 << OE_DEPTH_BITS)) {
|
||||
warning(_("delta chain depth %d is too deep, forcing %d"),
|
||||
depth, (1 << OE_DEPTH_BITS) - 1);
|
||||
depth = (1 << OE_DEPTH_BITS) - 1;
|
||||
}
|
||||
|
||||
argv_array_push(&rp, "pack-objects");
|
||||
if (thin) {
|
||||
use_internal_rev_list = 1;
|
||||
|
||||
Reference in New Issue
Block a user