Re: [PATCH v5 04/11] pack-objects: use bitfield for object_entry::depth
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2018-03-17 21:26:29
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2018-03-17 21:26:29
On Sat, Mar 17 2018, Nguyễn Thái Ngọc Duy jotted:
Because of struct packing from now on we can only handle max depth
4095
[...]
+ if (depth >= (1 << OE_DEPTH_BITS))
+ die(_("delta chain depth %d is greater than maximum limit %d"),
+ depth, (1 << OE_DEPTH_BITS));
+
This has a off-by-one error:
$ git repack --depth=4096
fatal: delta chain depth 4096 is greater than maximum limit 4096
Per the check we should be feeding `(1 << OE_DEPTH_BITS) - 1` to die().