ctucx.git: nimgit

[nimlang] nim-wrapper for libgit2

commit c563d6b781509730e3f1a34e9135d79043555b77
parent a38083061ec162bba4e56b38b0041af843ed5f1c
Author: Leah (ctucx) <leah@ctu.cx>
Date: Wed, 17 Mar 2021 18:24:55 +0100

utils.nim: new proc getLastError
1 file changed, 6 insertions(+), 2 deletions(-)
M
nimgit/utils.nim
|
8
++++++--
diff --git a/nimgit/utils.nim b/nimgit/utils.nim
@@ -2,7 +2,12 @@ import times
 import nimgit2
 import types
 
+proc getLastError* (): GitErrorObj = 
+    let error = git_error_last()
+
+    result.message = $error.message
+    result.class   = error.klass.getErrorClass
+
 proc parseGitTime* (time: git_time): GitTime =
     result.time     = fromUnix(time.time)
     result.offset   = time.offset
-    result.isSigned = (time.sign == '+')-
\ No newline at end of file