aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-reftable.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-07 15:16:14 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:53:09 -0700
commitb648bd654947db06e5549d724f46d3660ac11e19 (patch)
tree2b730c83c04b42385a489113d5e6f9a565beadfa /t/helper/test-reftable.c
parent6dcc05ffc3ead0745d19decd0e8ecd65edc9d414 (diff)
downloadgit-b648bd654947db06e5549d724f46d3660ac11e19.tar.gz
reftable/reader: rename data structure to "table"
The `struct reftable_reader` subsystem encapsulates a table that has been read from the disk. As such, the current name of that structure is somewhat hard to understand as it only talks about the fact that we read something from disk, without really giving an indicator _what_ that is. Furthermore, this naming schema doesn't really fit well into how the other structures are named: `reftable_merged_table`, `reftable_stack`, `reftable_block` and `reftable_record` are all named after what they encapsulate. Rename the subsystem to `reftable_table`, which directly gives a hint that the data structure is about handling the individual tables part of the stack. While this change results in a lot of churn, it prepares for us exposing the APIs to third-party callers now that the reftable library is a standalone library that can be linked against by other projects. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-reftable.c')
-rw-r--r--t/helper/test-reftable.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/t/helper/test-reftable.c b/t/helper/test-reftable.c
index 3c72ed985b..f8f1956f4f 100644
--- a/t/helper/test-reftable.c
+++ b/t/helper/test-reftable.c
@@ -4,8 +4,8 @@
#include "reftable/system.h"
#include "reftable/reftable-error.h"
#include "reftable/reftable-merged.h"
-#include "reftable/reftable-reader.h"
#include "reftable/reftable-stack.h"
+#include "reftable/reftable-table.h"
#include "test-tool.h"
static void print_help(void)
@@ -126,19 +126,19 @@ static int dump_reftable(const char *tablename)
{
struct reftable_block_source src = { 0 };
struct reftable_merged_table *mt = NULL;
- struct reftable_reader *r = NULL;
+ struct reftable_table *table = NULL;
int err;
err = reftable_block_source_from_file(&src, tablename);
if (err < 0)
goto done;
- err = reftable_reader_new(&r, &src, tablename);
+ err = reftable_table_new(&table, &src, tablename);
if (err < 0)
goto done;
- err = reftable_merged_table_new(&mt, &r, 1,
- reftable_reader_hash_id(r));
+ err = reftable_merged_table_new(&mt, &table, 1,
+ reftable_table_hash_id(table));
if (err < 0)
goto done;
@@ -146,7 +146,7 @@ static int dump_reftable(const char *tablename)
done:
reftable_merged_table_free(mt);
- reftable_reader_decref(r);
+ reftable_table_decref(table);
return err;
}
@@ -184,7 +184,7 @@ int cmd__dump_reftable(int argc, const char **argv)
arg = argv[1];
if (opt_dump_blocks) {
- err = reftable_reader_print_blocks(arg);
+ err = reftable_table_print_blocks(arg);
} else if (opt_dump_table) {
err = dump_reftable(arg);
} else if (opt_dump_stack) {