Read a tree into the index file
The current index contents will be replaced by the specified tree.
an existing index object
tree to read
0 or an error code