зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
e811530278
Коммит
3f9f1acccf
2
refs.c
2
refs.c
|
@ -313,7 +313,7 @@ int read_ref(const char *refname, struct object_id *oid)
|
|||
return read_ref_full(refname, RESOLVE_REF_READING, oid, NULL);
|
||||
}
|
||||
|
||||
static int refs_ref_exists(struct ref_store *refs, const char *refname)
|
||||
int refs_ref_exists(struct ref_store *refs, const char *refname)
|
||||
{
|
||||
return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL);
|
||||
}
|
||||
|
|
2
refs.h
2
refs.h
|
@ -105,6 +105,8 @@ int refs_verify_refname_available(struct ref_store *refs,
|
|||
const struct string_list *skip,
|
||||
struct strbuf *err);
|
||||
|
||||
int refs_ref_exists(struct ref_store *refs, const char *refname);
|
||||
|
||||
int ref_exists(const char *refname);
|
||||
|
||||
int should_autocreate_reflog(const char *refname);
|
||||
|
|
Загрузка…
Ссылка в новой задаче