diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-10-16 11:39:22 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-16 11:17:04 -0700 |
commit | 1e3ccb552f3d9166009ca2bc40b27bbc0c0e2b78 (patch) | |
tree | 598cbb7368a5626ded258ecf47df278c979ee5e4 /refs.c | |
parent | f65bb9fb06f969e8fb89de2d6dc9218f13cb361c (diff) | |
download | git-1e3ccb552f3d9166009ca2bc40b27bbc0c0e2b78.tar.gz |
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>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -309,7 +309,9 @@ int read_ref(const char *refname, struct object_id *oid) int refs_ref_exists(struct ref_store *refs, const char *refname) { - return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL); + int ignore_errno; + return !!refs_werrres_ref_unsafe(refs, refname, RESOLVE_REF_READING, + NULL, NULL, &ignore_errno); } int ref_exists(const char *refname) |