Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2022-01-20 18:12:11 +0300
committerJunio C Hamano <gitster@pobox.com>2022-01-20 22:31:53 +0300
commitc983374035bcba0f70d8908d735d17dfef4e0edf (patch)
tree28b97c2dc73ccfadf896b89b99ee4e61ea52208b /reftable/record.h
parenta94b94506b3318f6a04b4afb19f7f6779ce34f6e (diff)
reftable: implement record equality generically
This simplifies unittests a little, and provides further coverage for reftable_record_copy(). 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.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/reftable/record.h b/reftable/record.h
index 498e8c50bf..da75d7d1f1 100644
--- a/reftable/record.h
+++ b/reftable/record.h
@@ -58,6 +58,9 @@ struct reftable_record_vtable {
/* is this a tombstone? */
int (*is_deletion)(const void *rec);
+
+ /* 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);
};
/* record is a generic wrapper for different types of records. */
@@ -98,7 +101,7 @@ struct reftable_obj_record {
};
/* see struct record_vtable */
-
+int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, 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,