> From: Han-Wen Nienhuys <hanwen@xxxxxxxxxx> > > This introduces refs_resolve_ref_unsafe_with_errno(), which makes the API > contract for the errno output explicit. The implementation still relies on > the global errno variable to ensure no side effects. Looking at the next few patches, I think the plan is: - Introduce a new function refs_resolve_ref_unsafe_with_errno() which returns the error information in an out param instead of errno. Right now, it wraps refs_resolve_ref_unsafe(). - Migrate all callers that require the error information to refs_resolve_ref_unsafe_with_errno(), and leave all callers that do not require the error information alone (that is, using refs_resolve_ref_unsafe()). - To ensure that all callers using refs_resolve_ref_unsafe() really do not use errno, set it to 0. (This is allowed by the errno contract - successes can set errno to whatever they want.) If this is the plan, it should be written in the commit message. As it is, this patch handles the first and maybe part of the second step, and patch 5 handles the rest of the second step? I think the patches should be more clearly divided.