aboutsummaryrefslogtreecommitdiff
path: root/reftable/record_test.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-02-06 07:35:59 +0100
committerJunio C Hamano <gitster@pobox.com>2024-02-06 12:10:09 -0800
commit3ddef475d008b8a705a53e6bb1405bb773ffdc50 (patch)
tree1185254dfc15585b9504efc09b6f8a0e0b70eddd /reftable/record_test.c
parent62d3c8e8c8a3dc3113cead8d9dd36f7e59054670 (diff)
downloadgit-3ddef475d008b8a705a53e6bb1405bb773ffdc50.tar.xz
reftable/record: improve semantics when initializing records
According to our usual coding style, the `reftable_new_record()` function would indicate that it is allocating a new record. This is not the case though as the function merely initializes records without allocating any memory. Replace `reftable_new_record()` with a new `reftable_record_init()` function that takes a record pointer as input and initializes it accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/record_test.c')
-rw-r--r--reftable/record_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/reftable/record_test.c b/reftable/record_test.c
index 999366ad46..a86cff5526 100644
--- a/reftable/record_test.c
+++ b/reftable/record_test.c
@@ -16,11 +16,11 @@
static void test_copy(struct reftable_record *rec)
{
- struct reftable_record copy = { 0 };
+ struct reftable_record copy;
uint8_t typ;
typ = reftable_record_type(rec);
- copy = reftable_new_record(typ);
+ reftable_record_init(&copy, typ);
reftable_record_copy_from(&copy, rec, GIT_SHA1_RAWSZ);
/* do it twice to catch memory leaks */
reftable_record_copy_from(&copy, rec, GIT_SHA1_RAWSZ);