summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-18 00:15:59 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-18 00:15:59 +0100
commit3f964043f3a3f25d54a4f11b39eff93592c31e2c (patch)
tree69a1db0750c7439fcf8ed284cf5eb1ca9d65d2bc
parent848ddb8adc819e24caf4faba370876c40cf8d9e7 (diff)
downloadnimgit-3f964043f3a3f25d54a4f11b39eff93592c31e2c.tar.gz
nimgit-3f964043f3a3f25d54a4f11b39eff93592c31e2c.tar.bz2
nimgit-3f964043f3a3f25d54a4f11b39eff93592c31e2c.zip
utils.nim: new proc parseGitSignature
-rw-r--r--nimgit/utils.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/nimgit/utils.nim b/nimgit/utils.nim
index df42159..f1fa525 100644
--- 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)