summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-17 00:01:22 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-17 00:01:22 +0100
commit78ae4557c7a843414f1204239f72598c64f98d1f (patch)
tree26e0a895f04b49701e826a52f54dcaba9018c1e9
parent6df94530647028cd67cd4fd80f84f56a4dc6a7e6 (diff)
downloadnimgit-78ae4557c7a843414f1204239f72598c64f98d1f.tar.gz
nimgit-78ae4557c7a843414f1204239f72598c64f98d1f.tar.bz2
nimgit-78ae4557c7a843414f1204239f72598c64f98d1f.zip
fix up for new usage
-rw-r--r--listAllCommits.nim12
-rw-r--r--nimgit.nim4
2 files changed, 10 insertions, 6 deletions
diff --git a/listAllCommits.nim b/listAllCommits.nim
index 2e1b03b..3543381 100644
--- a/listAllCommits.nim
+++ b/listAllCommits.nim
@@ -8,10 +8,15 @@ if paramCount() == 0:
discard git_libgit2_init()
try:
- let gitRepository = openGitRepository(paramStr(1))
- let gitRevisionWalker = gitRepository.createRevisionWalker("HEAD")
+ var gitRepository = openGitRepository(paramStr(1))
+ let gitRevisionWalker = gitRepository.walk()
- for gitOid in gitRevisionWalker.walk():
+ gitRevisionWalker.sort(GIT_SORT_TOPOLOGICAL)
+ gitRevisionWalker.pushHead()
+
+ gitRevisionWalker.simplifyFirstParent()
+
+ for gitOid in gitRevisionWalker:
let gitCommit = gitRepository.lookupCommit(gitOid)
let author = gitCommit.getAuthor()
@@ -25,7 +30,6 @@ try:
free(gitCommit)
- free(gitRevisionWalker)
free(gitRepository)
except:
diff --git a/nimgit.nim b/nimgit.nim
index 174e3ee..8a81bca 100644
--- a/nimgit.nim
+++ b/nimgit.nim
@@ -1,6 +1,6 @@
import nimgit2
-import nimgit/[types, free, repository, objects, reference, commit]
+import nimgit/[types, free, repository, objects, reference, revisionWalker, branch, commit]
export nimgit2
-export types, free, objects, repository, reference, commit
+export types, free, objects, repository, reference, revisionWalker, branch, commit