diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-10-16 11:39:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-16 11:17:02 -0700 |
commit | ef18119dec8a9c65ed545fdd60c7ae9a6bc31f6f (patch) | |
tree | 1bf42ae6da39242d1accd5e05c624022f2b650b1 /refs | |
parent | branch tests: test for errno propagating on failing read (diff) | |
download | tgif-ef18119dec8a9c65ed545fdd60c7ae9a6bc31f6f.tar.xz |
refs API: add a version of refs_resolve_ref_unsafe() with "errno"
Add a new refs_werrres_ref_unsafe() function, which is like
refs_resolve_ref_unsafe() except that it explicitly saves away the
"errno" to a passed-in parameter, the refs_resolve_ref_unsafe() then
becomes a wrapper for it.
In subsequent commits we'll migrate code over to it, before finally
making "refs_resolve_ref_unsafe()" with an "errno" parameter the
canonical version, so this this function exists only so that we can
incrementally migrate callers, it will be going away in a subsequent
commit.
As the added comment notes has a rather tortured name to be the same
length as "refs_resolve_ref_unsafe", to avoid churn as we won't need
to re-indent the argument lists, similarly the documentation and
structure of it in refs.h is designed to minimize a diff in a
subsequent commit, where that documentation will be added to the new
refs_resolve_ref_unsafe().
At the end of this migration the "meaningful errno" TODO item left in
76d70dc0c63 (refs.c: make resolve_ref_unsafe set errno to something
meaningful on error, 2014-06-20) will be resolved.
As can be seen from the use of refs_read_raw_ref() we'll also need to
convert some functions that the new refs_werrres_ref_unsafe() itself
calls to take this "failure_errno". That will be done in subsequent
commits.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
0 files changed, 0 insertions, 0 deletions