summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2016-09-04 18:08:41 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-09 15:28:14 -0700
commit6fb5acfd8f7102f53dedc887233313f233a65932 (patch)
tree0e7bfa8bb9bff754e05680d9ab913f9fd0c310c0 /refs.c
parenta27dcf89b6867577bb714e181dd181cd1a1e6512 (diff)
downloadgit-6fb5acfd8f7102f53dedc887233313f233a65932.tar.gz
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>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index f26601dc0c..3b0a658c56 100644
--- a/refs.c
+++ b/refs.c
@@ -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)
{