ctucx.git: nimgit

[nimlang] nim-wrapper for libgit2

commit ed0f7b0fe5974ea589181a679ff02d040a2adcec
parent cf792ed268c47230306ccc18be197f1d05aba0fe
Author: Leah (ctucx) <leah@ctu.cx>
Date: Wed, 17 Mar 2021 16:33:13 +0100

commit.nim: new proc messageEncoding, owner; rename proc objectId -> id
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/nimgit/commit.nim b/nimgit/commit.nim
@@ -8,10 +8,13 @@ proc lookupCommit* (repo: GitRepository, oid: GitObjectId): GitCommit =
         free(result)
         raise newException(CatchableError, "Commit lookup failed: " & $error.getResultCode)
 
+proc owner* (commt: GitCommit): GitRepository = git_commit_owner(commit)
 
-proc objectId* (commit: GitCommit): GitObjectId = git_commit_id(commit)
+proc repo* (commit: GitCommit): GitRepository = commit.owner()
 
-proc `$`* (commit: GitCommit): string = $commit.objectId()
+proc id* (commit: GitCommit): GitObjectId = git_commit_id(commit)
+
+proc `$`* (commit: GitCommit): string = $commit.id()
 
 proc summary* (commit: GitCommit): string = $git_commit_summary(commit)
 

@@ -19,6 +22,7 @@ proc body* (commit: GitCommit): string = $git_commit_body(commit)
 
 proc message* (commit: GitCommit): string = $git_commit_message(commit)
 
+proc messageEncoding* (commit: GitCommit): string = $git_commit_message_encoding(commit)
 
 proc author* (commit: GitCommit): GitSignature =
     let author = git_commit_author(commit)