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: NRene Scharfe <l.s.r@web.de> Reviewed-by: NBrandon Williams <bmwill@google.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录