cache_name_compare(): do not truncate while comparing paths
authorJunio C Hamano <gitster@pobox.com>
Wed, 11 Jul 2012 16:08:28 +0000 (09:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Jul 2012 16:25:56 +0000 (09:25 -0700)
commitd5f53338ab2ee29c588f46d5cb28d7e3b25018f2
tree8cacf7445546eac4ec9cfd6c468f03be80121527
parentcb198b3b67feb2c0a6f22199ec14fa48d18ac1ce
cache_name_compare(): do not truncate while comparing paths

We failed to use ce_namelen() equivalent and instead only compared
up to the CE_NAMEMASK bytes by mistake.  Adding an overlong path
that shares the same common prefix as an existing entry in the index
did not add a new entry, but instead replaced the existing one, as
the result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c
t/t3006-ls-files-long.sh [new file with mode: 0755]