refs: add methods to init refs db

Alternate refs backends might not need the refs/heads directory and so
on, so we make ref db initialization part of the backend.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
David Turner
2016-09-04 18:08:41 +02:00
committed by Junio C Hamano
parent a27dcf89b6
commit 6fb5acfd8f
5 changed files with 42 additions and 10 deletions

8
refs.c
View File

@ -1292,6 +1292,14 @@ static const char *resolve_ref_recursively(struct ref_store *refs,
return NULL;
}
/* backend functions */
int refs_init_db(struct strbuf *err)
{
struct ref_store *refs = get_ref_store(NULL);
return refs->be->init_db(refs, err);
}
const char *resolve_ref_unsafe(const char *refname, int resolve_flags,
unsigned char *sha1, int *flags)
{