refs: make refs_ref_exists public
This will be necessary to replace file existence checks for pseudorefs. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Han-Wen Nienhuys committed
Aug 21, 2020 at 16:59 UTC
3f9f1acccf32fb1feda0f7ea8533bed2b594b1a0
2 files changed
+3
-1
refs.c
+1
-1
@@ -313,7 +313,7 @@ int read_ref(const char *refname, struct object_id *oid)
313
return read_ref_full(refname, RESOLVE_REF_READING, oid, NULL);
314
}
315
316
-static int refs_ref_exists(struct ref_store *refs, const char *refname)
316
+int refs_ref_exists(struct ref_store *refs, const char *refname)
317
{
318
return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL);
319
}
refs.h
+2
@@ -105,6 +105,8 @@ int refs_verify_refname_available(struct ref_store *refs,
105
const struct string_list *skip,
106
struct strbuf *err);
107
108
+int refs_ref_exists(struct ref_store *refs, const char *refname);
109
+
110
int ref_exists(const char *refname);
111
112
int should_autocreate_reflog(const char *refname);