diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2022-01-20 15:12:14 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-20 11:31:53 -0800 |
commit | 01033de49f26b75afd1e868d56c332c60b141faa (patch) | |
tree | 7cea687a208d1b6efa3f0b64b01e4bd16257894f /reftable/record.h | |
parent | reftable: make reftable_record a tagged union (diff) | |
download | tgif-01033de49f26b75afd1e868d56c332c60b141faa.tar.xz |
reftable: add print functions to the record types
This isn't used per se, but it is useful for debugging, especially
Windows CI failures.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/record.h')
-rw-r--r-- | reftable/record.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/reftable/record.h b/reftable/record.h index 010a322e90..fd80cd451d 100644 --- a/reftable/record.h +++ b/reftable/record.h @@ -61,6 +61,9 @@ struct reftable_record_vtable { /* Are two records equal? This assumes they have the same type. Returns 0 for non-equal. */ int (*equal)(const void *a, const void *b, int hash_size); + + /* Print on stdout, for debugging. */ + void (*print)(const void *rec, int hash_size); }; /* returns true for recognized block types. Block start with the block type. */ @@ -112,6 +115,7 @@ struct reftable_record { /* see struct record_vtable */ int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, int hash_size); +void reftable_record_print(struct reftable_record *rec, int hash_size); void reftable_record_key(struct reftable_record *rec, struct strbuf *dest); uint8_t reftable_record_type(struct reftable_record *rec); void reftable_record_copy_from(struct reftable_record *rec, |