cache: rename cache_name_compare() to name_compare()

The cache_name_compare() function is not specific to a cache.
Make its name more general by renaming it to name_compare().

Simplify cache_name_stage_compare() via name_compare().
Where lengths are involved, change int to size_t.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
tree-walk.c: remove name_compare() function

Remove the duplicate name_compare() function and use the one provided by
read-cache.c.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
unpack-trees.c: remove name_compare() function

Remove the duplicate name_compare() function and use the one provided by
read-cache.c.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
dir.c: rename to name_compare()

Rename the call to cache_name_compare() to name_compare().

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
name-hash.c: rename to name_compare()

Rename the call to cache_name_compare() to name_compare().

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>