summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-17 16:33:13 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-17 16:33:13 +0100
commited0f7b0fe5974ea589181a679ff02d040a2adcec (patch)
treed4e7a8ca818b1d02551251e427cf01f08f365f8e
parentcf792ed268c47230306ccc18be197f1d05aba0fe (diff)
downloadnimgit-ed0f7b0fe5974ea589181a679ff02d040a2adcec.tar.gz
nimgit-ed0f7b0fe5974ea589181a679ff02d040a2adcec.tar.bz2
nimgit-ed0f7b0fe5974ea589181a679ff02d040a2adcec.zip
commit.nim: new proc messageEncoding, owner; rename proc objectId -> id
-rw-r--r--nimgit/commit.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/nimgit/commit.nim b/nimgit/commit.nim
index c7158b5..2f43c5f 100644
--- 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)