alloc: add repository argument to alloc_tree_node