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

Method Close

odb.go:454–465  ·  view source on GitHub ↗

Close signals that all the data has been written and stores the resulting object id in the stream's Id field.

()

Source from the content-addressed store, hash-verified

452// Close signals that all the data has been written and stores the
453// resulting object id in the stream's Id field.
454func (stream *OdbWriteStream) Close() error {
455 runtime.LockOSThread()
456 defer runtime.UnlockOSThread()
457
458 ret := C.git_odb_stream_finalize_write(stream.Id.toC(), stream.ptr)
459 runtime.KeepAlive(stream)
460 if ret < 0 {
461 return MakeGitError(ret)
462 }
463
464 return nil
465}
466
467func (stream *OdbWriteStream) Free() {
468 runtime.SetFinalizer(stream, nil)

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
toCMethod · 0.45

Tested by

no test coverage detected