Adapt to API changes of libgit2.