Skip to content

Commit

Permalink
Merge pull request #465 from lhchavez/packbuilder-insert_from_walk
Browse files Browse the repository at this point in the history
Add support for Packbuilder.InsertFromWalk()

(cherry picked from commit b51a90c)
  • Loading branch information
carlosmn authored and lhchavez committed Aug 15, 2020
1 parent 638cb57 commit 97b4511
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 97b4511

Please sign in to comment.