This should restore the ability to include libgit2 headers in C++ projects. Cherry picked 2de60205 from development into new-error-handling.