ctucx.git: nimgit

[nimlang] nim-wrapper for libgit2

commit d3ecac993a1dbf2ef167d3f5f2dca080baeb0d74
parent 1ea2c761bdeaac89d3c00b30cd4780015b7db561
Author: Leah (ctucx) <leah@ctu.cx>
Date: Fri, 19 Mar 2021 14:01:09 +0100

treeEntry.nim: new proc compare
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/nimgit/treeEntry.nim b/nimgit/treeEntry.nim
@@ -18,6 +18,8 @@ proc copy* (entry: GitTreeEntry): GitTreeEntry =
         free(result)
         raise newException(CatchableError, "Cannot copy GitTreeEntry: " & $error.getResultCode)
 
+proc compare* (x: GitTreeEntry, y: GitTreeEntry): int = cast[int](git_tree_entry_cmp(x, y))
+
 proc getObject* (repo: GitRepository, entry: GitTreeEntry): GitBlob =
     var obj: GitObject
     let error = git_tree_entry_to_object(addr obj, repo, entry)