Re: [JGIT PATCH 01/14] Detect path names which overflow the name length field in the index
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 19, 2008, 00:11 UTC
- Message-ID
- <7v7iadlv7c.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1219103602-32222-2-git-send-email-spearce@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> C Git allows a path name to be longer than 4095 bytes by storing 4095 > into the path name length field within flags and then searching for a > null terminator at the end of the path name, instead of relying on the > length indicatior.
This reminds me.
In the longer term, we should make this "CE_NAMEMASK gives the real length for sane names but otherwise we need to count" merely a property of the on-disk index structure. In-core index should gain a new ce_namelen field that records the real name (even when it is longer than the mask would permit). IOW, the knowledge of CE_NAMEMASK should be confined to read_index_from() and ce_write_entry().
I expect this to be a relatively easy janitor project; hint, hint...