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

Method Read

odb.go:162–177  ·  view source on GitHub ↗
(oid *Oid)

Source from the content-addressed store, hash-verified

160}
161
162func (v *Odb) Read(oid *Oid) (obj *OdbObject, err error) {
163 obj = new(OdbObject)
164
165 runtime.LockOSThread()
166 defer runtime.UnlockOSThread()
167
168 ret := C.git_odb_read(&obj.ptr, v.ptr, oid.toC())
169 runtime.KeepAlive(v)
170 runtime.KeepAlive(oid)
171 if ret < 0 {
172 return nil, MakeGitError(ret)
173 }
174
175 runtime.SetFinalizer(obj, (*OdbObject).Free)
176 return obj, nil
177}
178
179func (odb *Odb) Refresh() error {
180 runtime.LockOSThread()

Callers 7

TestIndexerOutOfOrderFunction · 0.95
TestMempackFunction · 0.95
TestNoteIteratorFunction · 0.45
TestRemoveNoteFunction · 0.45
createTestNoteFunction · 0.45
TestOdbReadFunction · 0.45

Calls 2

MakeGitErrorFunction · 0.85
toCMethod · 0.45

Tested by 6

TestIndexerOutOfOrderFunction · 0.76
TestMempackFunction · 0.76
TestNoteIteratorFunction · 0.36
TestRemoveNoteFunction · 0.36
createTestNoteFunction · 0.36
TestOdbReadFunction · 0.36