summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-19 14:01:09 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-19 14:01:09 +0100
commitd3ecac993a1dbf2ef167d3f5f2dca080baeb0d74 (patch)
tree2c69d81f586d39a9647de85390527db24facf647
parent1ea2c761bdeaac89d3c00b30cd4780015b7db561 (diff)
downloadnimgit-d3ecac993a1dbf2ef167d3f5f2dca080baeb0d74.tar.gz
nimgit-d3ecac993a1dbf2ef167d3f5f2dca080baeb0d74.tar.bz2
nimgit-d3ecac993a1dbf2ef167d3f5f2dca080baeb0d74.zip
treeEntry.nim: new proc compare
-rw-r--r--nimgit/treeEntry.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/nimgit/treeEntry.nim b/nimgit/treeEntry.nim
index de6974b..4f1c2f0 100644
--- 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)