refs API: make refs_ref_exists() not set errno

Move refs_ref_exists from the legacy refs_resolve_ref_unsafe() to the new refs_werrres_ref_unsafe(). I have read its callers and determined that they don't care about errno being set, in particular: git grep -W -w -e refs_ref_exists -e ref_exists Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Oct 16, 2021 at 11:39 UTC 1e3ccb552f3d9166009ca2bc40b27bbc0c0e2b78
1 file changed +3 -1
refs.c
+3 -1
@@ -309,7 +309,9 @@ int read_ref(const char *refname, struct object_id *oid)
309
310 int refs_ref_exists(struct ref_store *refs, const char *refname)
311 {
312 - return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL);
312 + int ignore_errno;
313 + return !!refs_werrres_ref_unsafe(refs, refname, RESOLVE_REF_READING,
314 + NULL, NULL, &ignore_errno);
315 }
316
317 int ref_exists(const char *refname)