From 3dce444f178503bf3da13ade6f79c80d6964d175 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 4 Sep 2016 18:08:10 +0200 Subject: refs: add a backend method structure Add a `struct ref_storage_be` to represent types of reference stores. In OO notation, this is the class, and will soon hold some class methods (e.g., a factory to create new ref_store instances) and will also serve as the vtable for ref_store instances of that type. As yet, the backends cannot do anything. Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Jeff King Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 442c1a5db..52ea93b8c 100644 --- a/refs.h +++ b/refs.h @@ -544,4 +544,6 @@ int reflog_expire(const char *refname, const unsigned char *sha1, reflog_expiry_cleanup_fn cleanup_fn, void *policy_cb_data); +int ref_storage_backend_exists(const char *name); + #endif /* REFS_H */ -- cgit v1.2.1 From a8355bb717aaf2d5d9b3781aa78402d0053fa87a Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Sun, 4 Sep 2016 18:08:24 +0200 Subject: resolve_gitlink_ref(): rename path parameter to submodule Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 52ea93b8c..132dcef5a 100644 --- a/refs.h +++ b/refs.h @@ -77,11 +77,12 @@ int is_branch(const char *refname); int peel_ref(const char *refname, unsigned char *sha1); /** - * Resolve refname in the nested "gitlink" repository that is located - * at path. If the resolution is successful, return 0 and set sha1 to - * the name of the object; otherwise, return a non-zero value. + * Resolve refname in the nested "gitlink" repository in the specified + * submodule (which must be non-NULL). If the resolution is + * successful, return 0 and set sha1 to the name of the object; + * otherwise, return a non-zero value. */ -int resolve_gitlink_ref(const char *path, const char *refname, +int resolve_gitlink_ref(const char *submodule, const char *refname, unsigned char *sha1); /* -- cgit v1.2.1 From 6fb5acfd8f7102f53dedc887233313f233a65932 Mon Sep 17 00:00:00 2001 From: David Turner Date: Sun, 4 Sep 2016 18:08:41 +0200 Subject: 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 Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 132dcef5a..20fae94d7 100644 --- a/refs.h +++ b/refs.h @@ -66,6 +66,8 @@ int ref_exists(const char *refname); int is_branch(const char *refname); +extern int refs_init_db(struct strbuf *err); + /* * If refname is a non-symbolic reference that refers to a tag object, * and the tag can be (recursively) dereferenced to a non-tag object, -- cgit v1.2.1