There is already a PR open in libgit2: https://github.com/libgit2/libgit2/pull/2200