Create an in-memory copy of a Git object. The copy must be explicitly free'd or it will leak.
Pointer to store the copy of the object
Original object to copy
0 or an error code