git/t/unit-tests
Patrick Steinhardt fe446b01ae oidtree: extend iteration to allow for arbitrary return codes
The interface `cb_each()` iterates through a crit-bit tree and calls a
specific callback function for each of the contained items. The callback
function is expected to return either:

  - `CB_CONTINUE` in case iteration shall continue.

  - `CB_BREAK` to abort iteration.

This is needlessly restrictive though, as callers may want to return
arbitrary values and have them be bubbled up to the `cb_each()` call
site. In fact, this is a rather common pattern we have: whenever such a
callback function returns a non-zero error code, we abort iteration and
bubble up the code as-is.

Refactor both the crit-bit tree and oidtree subsystems to behave
accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-20 13:16:22 -07:00
..
clar global: constify some pointers that are not written to 2026-02-05 17:52:49 -08:00
.gitignore
generate-clar-decls.sh
generate-clar-suites.sh
lib-oid.c
lib-oid.h
lib-reftable.c
lib-reftable.h
test-lib.c
test-lib.h
u-ctype.c
u-dir.c
u-example-decorate.c
u-hash.c
u-hashmap.c
u-list-objects-filter-options.c list-objects-filter-options: support 'auto' mode for --filter 2026-02-17 11:46:40 -08:00
u-mem-pool.c
u-oid-array.c
u-oidmap.c oidmap: make entry cleanup explicit in oidmap_clear 2026-03-05 11:16:18 -08:00
u-oidtree.c oidtree: extend iteration to allow for arbitrary return codes 2026-03-20 13:16:22 -07:00
u-prio-queue.c
u-reftable-basics.c
u-reftable-block.c
u-reftable-merged.c
u-reftable-pq.c
u-reftable-readwrite.c
u-reftable-record.c
u-reftable-stack.c
u-reftable-table.c
u-reftable-tree.c
u-strbuf.c
u-strcmp-offset.c
u-string-list.c string-list: add string_list_sort_u() that mimics "sort -u" 2026-01-29 09:32:50 -08:00
u-strvec.c
u-trailer.c
u-urlmatch-normalization.c
u-utf8-width.c
unit-test.c
unit-test.h