ctucx.git: nimgit

[nimlang] nim-wrapper for libgit2

commit 3f964043f3a3f25d54a4f11b39eff93592c31e2c
parent 848ddb8adc819e24caf4faba370876c40cf8d9e7
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 18 Mar 2021 00:15:59 +0100

utils.nim: new proc parseGitSignature
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/nimgit/utils.nim b/nimgit/utils.nim
@@ -11,3 +11,8 @@ proc getLastError* (): GitErrorObj =
 proc parseGitTime* (time: git_time): GitTime =
     result.time     = fromUnix(time.time)
     result.offset   = time.offset
+
+proc parseGitSignature* (signature: ptr git_signature): GitSignature =
+    result.name  = $signature.name
+    result.email = $signature.email
+    result.when  = parseGitTime(signature.when)