Write the contents of the tree builder as a tree object using a shared git_buf.
Pointer to store the OID of the newly written tree
Tree builder to write
Shared buffer for writing the tree. Will be grown as necessary.
0 or an error code