summaryrefslogtreecommitdiff
path: root/refs/refs-internal.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-27 21:57:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-27 21:57:15 (GMT)
commit466be3e1dedc2725a436b128469b454ad8f1f578 (patch)
tree1f9a924c73fd337796a0416bc9fac93f4f24c6c5 /refs/refs-internal.h
parentbe6ab596a8e63f0bd6a5da0a97db78e0f0e41839 (diff)
parent3c0cb0cbaef699f699b79c8be716086053760ea9 (diff)
downloadgit-466be3e1dedc2725a436b128469b454ad8f1f578.zip
git-466be3e1dedc2725a436b128469b454ad8f1f578.tar.gz
git-466be3e1dedc2725a436b128469b454ad8f1f578.tar.bz2
Merge branch 'mh/submodule-hash'
Code and design clean-up for the refs API. * mh/submodule-hash: read_loose_refs(): read refs using resolve_ref_recursively() files_ref_store::submodule: use NULL for the main repository base_ref_store_init(): remove submodule argument refs: push the submodule attribute down refs: store submodule ref stores in a hashmap register_ref_store(): new function refs: remove some unnecessary handling of submodule == "" refs: make some ref_store lookup functions private refs: reorder some function definitions
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r--refs/refs-internal.h48
1 files changed, 7 insertions, 41 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 611ab5b..fa93c9a 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -635,47 +635,14 @@ extern struct ref_storage_be refs_be_files;
struct ref_store {
/* The backend describing this ref_store's storage scheme: */
const struct ref_storage_be *be;
-
- /*
- * The name of the submodule represented by this object, or
- * the empty string if it represents the main repository's
- * reference store:
- */
- const char *submodule;
-
- /*
- * Submodule reference store instances are stored in a linked
- * list using this pointer.
- */
- struct ref_store *next;
};
/*
- * Fill in the generic part of refs for the specified submodule and
- * add it to our collection of reference stores.
+ * Fill in the generic part of refs and add it to our collection of
+ * reference stores.
*/
void base_ref_store_init(struct ref_store *refs,
- const struct ref_storage_be *be,
- const char *submodule);
-
-/*
- * Create, record, and return a ref_store instance for the specified
- * submodule (or the main repository if submodule is NULL).
- *
- * For backwards compatibility, submodule=="" is treated the same as
- * submodule==NULL.
- */
-struct ref_store *ref_store_init(const char *submodule);
-
-/*
- * Return the ref_store instance for the specified submodule (or the
- * main repository if submodule is NULL). If that ref_store hasn't
- * been initialized yet, return NULL.
- *
- * For backwards compatibility, submodule=="" is treated the same as
- * submodule==NULL.
- */
-struct ref_store *lookup_ref_store(const char *submodule);
+ const struct ref_storage_be *be);
/*
* Return the ref_store instance for the specified submodule. For the
@@ -689,10 +656,9 @@ struct ref_store *lookup_ref_store(const char *submodule);
*/
struct ref_store *get_ref_store(const char *submodule);
-/*
- * Die if refs is for a submodule (i.e., not for the main repository).
- * caller is used in any necessary error messages.
- */
-void assert_main_repository(struct ref_store *refs, const char *caller);
+const char *resolve_ref_recursively(struct ref_store *refs,
+ const char *refname,
+ int resolve_flags,
+ unsigned char *sha1, int *flags);
#endif /* REFS_REFS_INTERNAL_H */