name-hash: properly fold directory names in adjust_dirname_case()
authorBen Peart <benpeart@microsoft.com>
Thu, 8 Feb 2018 19:23:33 +0000 (14:23 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Feb 2018 20:20:56 +0000 (12:20 -0800)
commitc95525e90d2f3c75b879ce51fd17d263a6452de3
tree80ef01e21e321ec56c9346bea8e664777ad3ba5e
parent27dea4683b608c5c0487dee74cbda13b62803b73
name-hash: properly fold directory names in adjust_dirname_case()

Correct the pointer arithmetic in adjust_dirname_case() so that it calls
find_dir_entry() with the correct string length.  Previously passing in
"dir1/foo" would pass a length of 6 instead of the correct 4.  This resulted in
find_dir_entry() never finding the entry and so the subsequent memcpy that would
fold the name to the version with the correct case never executed.

Add a test to validate the corrected behavior with name folding of directories.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
name-hash.c
t/t0050-filesystem.sh