builtin/write-tree: convert to struct object_id