sha1_file: convert read_object_with_reference to object_id