Close signals that all the data has been written and stores the resulting object id in the stream's Id field.
()
| 452 | // Close signals that all the data has been written and stores the |
| 453 | // resulting object id in the stream's Id field. |
| 454 | func (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 | |
| 467 | func (stream *OdbWriteStream) Free() { |
| 468 | runtime.SetFinalizer(stream, nil) |
nothing calls this directly
no test coverage detected