Commit 74ffce20780783e20668f7ac9d543cfc3e03fe0c

Edward Thomson 2021-12-11T12:00:26

oid: introduce `git_oid_t` We require an enumeration to help us identify the different types of object IDs. Currently, we only support SHA1 but we will support SHA256 in the future.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 3dedae8..8f92e75 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -19,6 +19,11 @@
  */
 GIT_BEGIN_DECL
 
+/** The type of object id, currently only SHA1. */
+typedef enum {
+	GIT_OID_SHA1 = 1   /**< SHA1 */
+} git_oid_t;
+
 /** Size (in bytes) of a raw/binary oid */
 #define GIT_OID_SHA1_SIZE 20