ls-files: pass prefix length explicitly to prune_cache()
commit7b4158a8d8d027491e6e2f7eff3789bd25e093d5
authorRené Scharfe <l.s.r@web.de>
Fri, 10 Feb 2017 19:42:28 +0000 (10 20:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Feb 2017 20:06:08 +0000 (13 12:06 -0800)
tree7e5720fb483b8e70afd81f73402b974c86f41860
parent3b9e3c2cede15057af3ff8076c45ad5f33829436
ls-files: pass prefix length explicitly to prune_cache()

The function prune_cache() relies on the fact that it is only called on
max_prefix and sneakily uses the matching global variable max_prefix_len
directly.  Tighten its interface by passing both the string and its
length as parameters.  While at it move the NULL check into the function
to collect all cache-pruning related logic in one place.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-files.c