Fix repository.write

Libgit2 has new interface.