tree: add repository argument to lookup_tree