There are several functions in libgit2, especially those that return pointers, that don't provide any information about errors. For example, git_repository_open returns NULL when a git directory is invalid, but also when out of memory.
It would be great if we could count on any function that can cause an error to set git_errno. For functions that also return an error code, it should be possible to write a macro to set and return git_errno in one statement.
There are several functions in libgit2, especially those that return pointers, that don't provide any information about errors. For example, git_repository_open returns NULL when a git directory is invalid, but also when out of memory.
It would be great if we could count on any function that can cause an error to set git_errno. For functions that also return an error code, it should be possible to write a macro to set and return git_errno in one statement.