mirror of
https://github.com/git/git
synced 2024-07-05 00:58:49 +00:00
There exist a bunch of call sites in the reftable backend that want to create iterators for a reftable stack. This is rather convoluted right now, where you always have to go via the merged table. And it is about to become even more convoluted when we split up iterator initialization and seeking in the next commit. Introduce convenience functions that allow the caller to create an iterator from a reftable stack directly without going through the merged table. Adapt callers accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
36 lines
747 B
C
36 lines
747 B
C
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by a BSD-style
|
|
license that can be found in the LICENSE file or at
|
|
https://developers.google.com/open-source/licenses/bsd
|
|
*/
|
|
|
|
#ifndef MERGED_H
|
|
#define MERGED_H
|
|
|
|
#include "system.h"
|
|
|
|
struct reftable_merged_table {
|
|
struct reftable_table *stack;
|
|
size_t stack_len;
|
|
uint32_t hash_id;
|
|
|
|
/* If unset, produce deletions. This is useful for compaction. For the
|
|
* full stack, deletions should be produced. */
|
|
int suppress_deletions;
|
|
|
|
uint64_t min;
|
|
uint64_t max;
|
|
};
|
|
|
|
void merged_table_release(struct reftable_merged_table *mt);
|
|
|
|
struct reftable_iterator;
|
|
|
|
void merged_table_init_iter(struct reftable_merged_table *mt,
|
|
struct reftable_iterator *it,
|
|
uint8_t typ);
|
|
|
|
#endif
|