]> git.ipfire.org Git - thirdparty/git.git/commit
odb: update `struct odb_write_stream` read() callback
authorJustin Tobler <jltobler@gmail.com>
Thu, 14 May 2026 18:37:36 +0000 (13:37 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 May 2026 19:44:40 +0000 (04:44 +0900)
commit970f63519e494b590c807972af6c40477e14bc61
treed84eb61fe28b93262896415f3600a69658cb73f8
parent10cdbc7423b2f5f9c666c48fe8a6e6e044595799
odb: update `struct odb_write_stream` read() callback

The `read()` callback used by `struct odb_write_stream` currently
returns a pointer to an internal buffer along with the number of bytes
read. This makes buffer ownership unclear and provides no way to report
errors.

Update the interface to instead require the caller to provide a buffer,
and have the callback return the number of bytes written to it or a
negative value on error. While at it, also move the `struct
odb_write_stream` definition to "odb/streaming.h". Call sites are
updated accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/unpack-objects.c
object-file.c
odb.h
odb/streaming.c
odb/streaming.h