summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-26 13:57:48 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-20 17:09:46 -0400
commitdbccfc203e776196ea2901dbcb652bba6a848a30 (patch)
tree1261d2fcb2429a783aa6da43712133bb334fe093 /include
parent3eba9181cf74693d5906c799e08aba15b5745355 (diff)
downloadlibgit2-dbccfc203e776196ea2901dbcb652bba6a848a30.tar.gz
odb: accept an oid type in options
Allow the object database to take an oid type that it supports. This oid type will be used to validate the objects that the backends provide.
Diffstat (limited to 'include')
-rw-r--r--include/git2/odb.h6
-rw-r--r--include/git2/odb_backend.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h
index 12b5fc730..0952a1be0 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -41,6 +41,12 @@ typedef int GIT_CALLBACK(git_odb_foreach_cb)(const git_oid *id, void *payload);
/** Options for configuring a loose object backend. */
typedef struct {
unsigned int version; /**< version for the struct */
+
+ /**
+ * Type of object IDs to use for this object database, or
+ * 0 for default (currently SHA1).
+ */
+ git_oid_t oid_type;
} git_odb_options;
/* The current version of the diff options structure */
diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h
index 5ad777b17..d93ac7348 100644
--- a/include/git2/odb_backend.h
+++ b/include/git2/odb_backend.h
@@ -87,6 +87,8 @@ struct git_odb_stream {
unsigned int mode;
void *hash_ctx;
+ git_oid_t oid_type;
+
git_object_size_t declared_size;
git_object_size_t received_bytes;