sha1_loose_object_info: make type lookup optional