See https://github.com/libgit2/libgit2/issues/2182