Skip to content

Commit 1e3ccb5

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f65bb9f commit 1e3ccb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

refs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ int read_ref(const char *refname, struct object_id *oid)
309309

310310
int refs_ref_exists(struct ref_store *refs, const char *refname)
311311
{
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);
313315
}
314316

315317
int ref_exists(const char *refname)

0 commit comments

Comments
 (0)