summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2018-11-15 02:27:03 +0000
committerlhchavez <[email protected]>2018-11-15 03:20:51 +0000
commit8d27336e8a158dccc55c966f57ff7e90acce1614 (patch)
tree24f70f290b801621ab955a8785ed0d73c784b809
parenteec1547c20617534ad9e825673bf78e355dda7d9 (diff)
Add support for Packbuilder.InsertFromWalk()
This change adds support for Packbuilder.InsertFromWalk() from libgit2.
-rw-r--r--packbuilder.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/packbuilder.go b/packbuilder.go
index 0e04bbf..576e5ca 100644
--- a/packbuilder.go
+++ b/packbuilder.go
@@ -85,6 +85,19 @@ func (pb *Packbuilder) InsertTree(id *Oid) error {
return nil
}
+func (pb *Packbuilder) InsertWalk(walk *RevWalk) error {
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
+ ret := C.git_packbuilder_insert_walk(pb.ptr, walk.ptr)
+ runtime.KeepAlive(pb)
+ runtime.KeepAlive(walk)
+ if ret != 0 {
+ return MakeGitError(ret)
+ }
+ return nil
+}
+
func (pb *Packbuilder) ObjectCount() uint32 {
ret := uint32(C.git_packbuilder_object_count(pb.ptr))
runtime.KeepAlive(pb)