Skip to content

Commit 3f9f1ac

Browse files
hanwengitster
authored andcommitted
refs: make refs_ref_exists public
This will be necessary to replace file existence checks for pseudorefs. Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e811530 commit 3f9f1ac

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ int read_ref(const char *refname, struct object_id *oid)
313313
return read_ref_full(refname, RESOLVE_REF_READING, oid, NULL);
314314
}
315315

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)
317317
{
318318
return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL);
319319
}

refs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ int refs_verify_refname_available(struct ref_store *refs,
105105
const struct string_list *skip,
106106
struct strbuf *err);
107107

108+
int refs_ref_exists(struct ref_store *refs, const char *refname);
109+
108110
int ref_exists(const char *refname);
109111

110112
int should_autocreate_reflog(const char *refname);

0 commit comments

Comments
 (0)