]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/table: move printing logic into test helper
authorPatrick Steinhardt <ps@pks.im>
Mon, 7 Apr 2025 13:16:28 +0000 (15:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Apr 2025 21:53:13 +0000 (14:53 -0700)
commite0011188ca0edc31ed861357014fd0f229d67448
treef398174d0a24898504f8b2c872aad3f98e6d2925
parent0f8ee94b636b5ab183c62b8fdd26c1611c2b86f4
reftable/table: move printing logic into test helper

The logic to print individual blocks in a table is hosted in the
reftable library. This is only the case due to historical reasons though
because users of the library had no interfaces to read blocks one by
one. Otherwise, printing individual blocks has no place in the reftable
library given that the format will not be generic in the first place.

We have now grown a public interface to iterate through blocks contained
in a table, and thus we can finally move the logic to print them into
the test helper.

Move over the logic and refactor it accordingly. Note that the iterator
also trivially allows us to access index sections, which we previously
didn't print at all. This omission wasn't intentional though, so start
dumping those sections as well so that we can assert that indices are
written as expected.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/reftable-table.h
reftable/table.c
t/helper/test-reftable.c
t/t0613-reftable-write-options.sh