Use GError instead of raw git2 error codes
Annotate @cred as out