Check libgit2 error code, printing error to stderr on failure and exiting the program.
See Implementation
Check libgit2 error code, printing error to stderr on failure and exiting the program.