ctucx.git: nimgit

[nimlang] nim-wrapper for libgit2

commit 1e0f00b7546d535d96a0126f9840424a02878486
parent 2c5ccc3dc6a01b7b90212f60bd70faf6d2271b39
Author: Leah (ctucx) <leah@ctu.cx>
Date: Wed, 17 Mar 2021 02:23:42 +0100

add new types
1 file changed, 14 insertions(+), 0 deletions(-)
M
nimgit/types.nim
|
14
++++++++++++++
diff --git a/nimgit/types.nim b/nimgit/types.nim
@@ -6,9 +6,23 @@ type
     GitObject*          = ptr git_object
     GitObjectId*        = ptr git_oid
     GitCommit*          = ptr git_commit
+    GitTree*            = ptr git_tree
     GitReference*       = ptr git_reference
     GitRevisionWalker*  = ptr git_revwalk
     GitBranchIterator*  = ptr git_branch_iterator
+    
+    GitObjectKind* = enum
+        # we have to add 2 here to satisfy nim; discriminants.low must be zero
+        goAny         = (2 + GIT_OBJECT_ANY, "object")        # -2
+        goInvalid     = (2 + GIT_OBJECT_INVALID, "invalid")   # -1
+        # this space intentionally left blank
+        goCommit      = (2 + GIT_OBJECT_COMMIT, "commit")     #  1
+        goTree        = (2 + GIT_OBJECT_TREE, "tree")         #  2
+        goBlob        = (2 + GIT_OBJECT_BLOB, "blob")         #  3
+        goTag         = (2 + GIT_OBJECT_TAG, "tag")           #  4
+        # this space intentionally left blank
+        goOfsDelta    = (2 + GIT_OBJECT_OFS_DELTA, "ofs")     #  6
+        goRefDelta    = (2 + GIT_OBJECT_REF_DELTA, "ref")     #  7
 
     GitTime* = object
         time*     : Time