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

Method WriteToFile

packbuilder.go:108–121  ·  view source on GitHub ↗
(name string, mode os.FileMode)

Source from the content-addressed store, hash-verified

106}
107
108func (pb *Packbuilder) WriteToFile(name string, mode os.FileMode) error {
109 cname := C.CString(name)
110 defer C.free(unsafe.Pointer(cname))
111
112 runtime.LockOSThread()
113 defer runtime.UnlockOSThread()
114
115 ret := C.git_packbuilder_write(pb.ptr, cname, C.uint(mode.Perm()), nil, nil)
116 runtime.KeepAlive(pb)
117 if ret != 0 {
118 return MakeGitError(ret)
119 }
120 return nil
121}
122
123func (pb *Packbuilder) Write(w io.Writer) error {
124 return pb.ForEach(func(slice []byte) error {

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected