]> git.ipfire.org Git - thirdparty/git.git/commit
oidtree: add ability to store data
authorPatrick Steinhardt <ps@pks.im>
Fri, 10 Apr 2026 12:12:39 +0000 (14:12 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 May 2026 19:50:45 +0000 (04:50 +0900)
commit449650decf49b1fe5b1dac1c48dfb919e9b57b0d
treee2dce81e92c49e92fa8c8e24118dd0d0afd4b393
parent550d7b7c89a9cf80794c72e8c7d036164a5b1927
oidtree: add ability to store data

The oidtree data structure is currently only used to store object IDs,
without any associated data. So consequently, it can only really be used
to track which object IDs exist, and we can use the tree structure to
efficiently operate on OID prefixes.

But there are valid use cases where we want to both:

  - Store object IDs in a sorted order.

  - Associated arbitrary data with them.

Refactor the oidtree interface so that it allows us to store arbitrary
payloads within the respective nodes. This will be used in the next
commit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
loose.c
object-file.c
oidtree.c
oidtree.h
t/unit-tests/u-oidtree.c