https://github.com/libgit2/libgit2/pull/2017