Adapted code to compile with libgit2 0.21.3.

This does not mean that it works.