Write the contents of the tree builder as a tree object
The tree builder will be written to the given repo, and its identifying SHA1 hash will be stored in the id pointer.
repo
id
Pointer to store the OID of the newly written tree
Tree builder to write
0 or an error code