/* * Create, record, and return a ref_store instance for the specified * submodule (or the main repository if submodule is NULL). */ static struct ref_store *ref_store_init(const char *submodule) { const char *be_name = "files"; struct ref_storage_be *be = find_ref_storage_backend(be_name); struct ref_store *refs; if (!be) die("BUG: reference backend %s is unknown", be_name); refs = be->init(submodule); register_ref_store(refs, submodule); return refs; }
struct ref_store *ref_store_init(const char *submodule) { const char *be_name = "files"; struct ref_storage_be *be = find_ref_storage_backend(be_name); if (!be) die("BUG: reference backend %s is unknown", be_name); if (!submodule || !*submodule) return be->init(NULL); else return be->init(submodule); }
/* * Create, record, and return a ref_store instance for the specified * gitdir. */ static struct ref_store *ref_store_init(const char *gitdir, unsigned int flags) { const char *be_name = "files"; struct ref_storage_be *be = find_ref_storage_backend(be_name); struct ref_store *refs; if (!be) die("BUG: reference backend %s is unknown", be_name); refs = be->init(gitdir, flags); return refs; }
int ref_storage_backend_exists(const char *name) { return find_ref_storage_backend(name) != NULL; }