[PATCH 0/8] chunk-format: introduce `pair_chunk_expect()` convenience API
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Oct 13, 2023, 19:25 UTC
- Message-ID
- <cover.1697225110.git.me@ttaylorr.com>
- In-Reply-To
- <20231009205544.GA3281950@coredump.intra.peff.net>
While reviewing this series, I noticed a couple of spots that would be helped by having a convenience function that stores the start of a chunk in a designated location *after* checking that the chunk has the expected size.
I called this function `pair_chunk_expect()` and touched up seven spots that I think could benefit from having a convenience function like this.
This applies directly on top of 'jk/chunk-bounds'. Thanks in advance for your review!
Taylor Blau (8): chunk-format: introduce `pair_chunk_expect()` helper commit-graph: read `OIDF` chunk with `pair_chunk_expect()` commit-graph: read `CDAT` chunk with `pair_chunk_expect()` commit-graph: read `GDAT` chunk with `pair_chunk_expect()` commit-graph: read `BIDX` chunk with `pair_chunk_expect()` midx: read `OIDF` chunk with `pair_chunk_expect()` midx: read `OIDL` chunk with `pair_chunk_expect()` midx: read `OOFF` chunk with `pair_chunk_expect()`
chunk-format.c | 22 +++++++++++++++++ chunk-format.h | 12 +++++++++- commit-graph.c | 65 +++++++++++++------------------------------------- midx.c | 58 ++++++++++++-------------------------------- 4 files changed, 65 insertions(+), 92 deletions(-)
-- 2.42.0.352.gd9c5062ff7.dirty