MCPcopy Create free account
hub / github.com/libgit2/git2go / Insert

Method Insert

packbuilder.go:47–61  ·  view source on GitHub ↗
(id *Oid, name string)

Source from the content-addressed store, hash-verified

45}
46
47func (pb *Packbuilder) Insert(id *Oid, name string) error {
48 cname := C.CString(name)
49 defer C.free(unsafe.Pointer(cname))
50
51 runtime.LockOSThread()
52 defer runtime.UnlockOSThread()
53
54 ret := C.git_packbuilder_insert(pb.ptr, id.toC(), cname)
55 runtime.KeepAlive(pb)
56 runtime.KeepAlive(id)
57 if ret != 0 {
58 return MakeGitError(ret)
59 }
60 return nil
61}
62
63func (pb *Packbuilder) InsertCommit(id *Oid) error {
64 runtime.LockOSThread()

Callers

nothing calls this directly

Calls 3

MakeGitErrorFunction · 0.85
freeMethod · 0.80
toCMethod · 0.45

Tested by

no test coverage detected