aboutsummaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@google.com>2016-09-04 18:08:10 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-09 15:28:12 -0700
commit3dce444f178503bf3da13ade6f79c80d6964d175 (patch)
tree85c8e334ab027c9abcfb249c4337c711f2bf43c1 /refs
parent65a0a8e5facb42f41561a96af209016954878b63 (diff)
downloadgit-3dce444f178503bf3da13ade6f79c80d6964d175.tar.gz
git-3dce444f178503bf3da13ade6f79c80d6964d175.tar.xz
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 <sahlberg@google.com> Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c5
-rw-r--r--refs/refs-internal.h8
2 files changed, 13 insertions, 0 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index c229b56bd..0102491b1 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -4066,3 +4066,8 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
unlock_ref(lock);
return -1;
}
+
+struct ref_storage_be refs_be_files = {
+ NULL,
+ "files"
+};
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 0206e2b95..2c9d13402 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -525,4 +525,12 @@ int do_for_each_ref_iterator(struct ref_iterator *iter,
int read_raw_ref(const char *refname, unsigned char *sha1,
struct strbuf *referent, unsigned int *type);
+/* refs backends */
+struct ref_storage_be {
+ struct ref_storage_be *next;
+ const char *name;
+};
+
+extern struct ref_storage_be refs_be_files;
+
#endif /* REFS_REFS_INTERNAL_H */