Maybe this is related?
https://github.com/libgit2/libgit2/pull/1781#issuecomment-22635913