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
GIT_SUCCESS or an error code