libgit2/libgit2 — pull request #1941 by arrbee (2013-11-04 23:52:42+00:00)
Title: Preserve error messages during file system iterator cleanup

When the filesystem iterator encounters an error reading from the filesystem, it sends the error code back to the caller, but the internal cleanup code may end up clearing the error message. This PR introduces a new API `giterr_detach` that lets you take over the current error message so it can be restored later on and fixes the filesystem iterator to use it. This also injects a new baseline `git_error_t` value of `GITERR_NONE` to take over the zero value and indicate when there is no error to detach.

This is designed to fix issue #1868