See this comment in git2-rs for details: https://github.com/alexcrichton/git2-rs/pull/315#issuecomment-393006101