summaryrefslogtreecommitdiff
path: root/repository.go
diff options
context:
space:
mode:
authorVicent Martí <[email protected]>2013-03-05 13:14:58 -0800
committerVicent Martí <[email protected]>2013-03-05 13:14:58 -0800
commitdd2ad2bf6b6fa87b480a96adbc67d44c63e0a39d (patch)
treeeee499cc976a20ab0aa9f064a42f24c3085b26c8 /repository.go
parent439f7acf2865af07f970b8bfe2691b70eca7c973 (diff)
parent93ab5a1c3e81a988523b716befce2555353396e2 (diff)
Merge pull request #1 from carlosmn/revwalk
Bring back the RevWalk
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/repository.go b/repository.go
index 3b845e7..755926e 100644
--- a/repository.go
+++ b/repository.go
@@ -81,6 +81,18 @@ func (v *Repository) LookupCommit(o *Oid) (*Commit, error) {
return commit, nil
}
+func (v *Repository) Walk() (*RevWalk, error) {
+ walk := new(RevWalk)
+ ecode := C.git_revwalk_new(&walk.ptr, v.ptr)
+ if ecode < 0 {
+ return nil, LastError()
+ }
+
+ walk.repo = v
+ runtime.SetFinalizer(walk, freeRevWalk)
+ return walk, nil
+}
+
/* TODO
func (v *Repository) Commit(
refname string, author, committer *Signature,