libgit2/libgit2 — pull request #590 by arrbee (2012-03-07 00:35:34+00:00)
Title: Migrating diff to new error handling

Ended up migrating a bunch of upstream functions as well, including vector, attr_file, and odb in order to get this to work right.

Please take a look and let me know if I've done this in the style you want, @tanoku.

I did one thing that may be particularly questionable, which is that I modified `giterr_set()` so that if you pass `GITERR_OS` for the error class, then it will automatically append the `strerror(errno)` to the error message. This allowed me to eliminate this part of error messages around the code base which seemed cleaner to me.

I also added a new function `git_futils_open_ro()` which wraps `p_open()` and automatically calls `giterr_set()` as needed, plus translates `ENOENT` into `GIT_ENOTFOUND` for us. Again, this eliminated some repeated code.