Updates some entries in the index from the target commit tree.
The scope of the updated entries is determined by the paths
being passed in the pathspec
parameters.
Passing a NULL target
will result in removing
entries in the index matching the provided pathspecs.
0 on success or an error code < 0