libgit2/libgit2 — pull request #1526 by arrbee (2013-05-01 12:04:07+00:00)
Title: Make sure error messages are set for most error returns

Generally, when a library function returns an error code, it should set the error message.

The only exception, I believe, is when the function is essentially returning a boolean check of some property, where it could use 0 to indicate the that check was fine, and -1 (or GIT_ENOTFOUND) to indicate the check failed. Since the only reason to call such a function is to look at the return value, setting an error message is not critical in that one case.

However, there are a few places where we aren't following that rule and return an error code without setting a message. I wanted to try to clean up some of that before a 1.0 release.

This PR is the result of walking through the code and finding places that need error messages. It started out to address the situation in issue #1521 and has expanded from there.

This is still a work in progress.