sha1_name.c: prepare to make get_tree_entry() reusable from others.