Index: accept a tree for read_tree()

An index may not have an associated repository, so giving it an id in
that case is useless. Raise an error in that case and accept a Tree
object to make the function useful then.