diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-07-02 14:02:00 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-07-02 09:52:32 -0700 |
| commit | 126076b62f5164f9da6bbe454fc71c164ea5cb42 (patch) | |
| tree | d71c6366130b5a211ed57be2ed66e7274e2c3901 /t/t4013/diff.diff_initial..side | |
| parent | 11c689b8730e0927ef9fc73eea59270318b3177d (diff) | |
odb: make backend-specific fields optional
The `struct object_info` carries two pieces of information
about how an object was looked up:
- The `whence` enum identifying the backend.
- The backend-tagged union `u` exposing backend-specific details
(currently only the packed-source case, which records the owning
pack, offset and packed object type).
The union is populated unconditionally, even though most callers don't
care about provenance at all.
Split the backend-specific union out into a new public type, `struct
object_info_source`, and make the object info structure carry it via
just another opt-in request pointer. As with all the other requestable
information, callers that need source info allocate a `struct
object_info_source` on the stack and point `sourcep` at it; callers that
don't care about it simply leave the field as a `NULL` pointer. Adapt
callers accordingly.
Note that the `whence` enum is strictly-speaking also backend-specific
information, so it would be another good candidate to be moved into the
`struct object_info_source`. For now though it is left alone, as it will
be replaced by a `struct odb_source` pointer in a subsequent commit.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions
