| 364 | } |
| 365 | |
| 366 | int reftable_block_first_key(const struct reftable_block *block, struct reftable_buf *key) |
| 367 | { |
| 368 | int off = block->header_off + 4, n; |
| 369 | struct string_view in = { |
| 370 | .buf = block->block_data.data + off, |
| 371 | .len = block->restart_off - off, |
| 372 | }; |
| 373 | uint8_t extra = 0; |
| 374 | |
| 375 | reftable_buf_reset(key); |
| 376 | |
| 377 | n = reftable_decode_key(key, &extra, in); |
| 378 | if (n < 0) |
| 379 | return n; |
| 380 | if (!key->len) |
| 381 | return REFTABLE_FORMAT_ERROR; |
| 382 | |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | static uint32_t block_restart_offset(const struct reftable_block *b, size_t idx) |
| 387 | { |
no test coverage detected