Skip to content

Commit 55c7ff4

Browse files
pks-tgitster
authored andcommitted
reftable/dump: drop unused compact_stack()
The `compact_stack()` function is exposed via `reftable_dump_main()`, which ultimately ends up being wired into "test-tool reftable". It is never used by our tests though, and nowadays we have wired up support for stack compaction into git-pack-refs(1). Remove the code. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f2406c8 commit 55c7ff4

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

reftable/dump.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,10 @@ license that can be found in the LICENSE file or at
2424
#include <unistd.h>
2525
#include <string.h>
2626

27-
static int compact_stack(const char *stackdir)
28-
{
29-
struct reftable_stack *stack = NULL;
30-
struct reftable_write_options opts = { 0 };
31-
32-
int err = reftable_new_stack(&stack, stackdir, &opts);
33-
if (err < 0)
34-
goto done;
35-
36-
err = reftable_stack_compact_all(stack, NULL);
37-
if (err < 0)
38-
goto done;
39-
done:
40-
if (stack) {
41-
reftable_stack_destroy(stack);
42-
}
43-
return err;
44-
}
45-
4627
static void print_help(void)
4728
{
48-
printf("usage: dump [-cst] arg\n\n"
29+
printf("usage: dump [-st] arg\n\n"
4930
"options: \n"
50-
" -c compact\n"
5131
" -b dump blocks\n"
5232
" -t dump table\n"
5333
" -s dump stack\n"
@@ -62,7 +42,6 @@ int reftable_dump_main(int argc, char *const *argv)
6242
int opt_dump_blocks = 0;
6343
int opt_dump_table = 0;
6444
int opt_dump_stack = 0;
65-
int opt_compact = 0;
6645
uint32_t opt_hash_id = GIT_SHA1_FORMAT_ID;
6746
const char *arg = NULL, *argv0 = argv[0];
6847

@@ -77,8 +56,6 @@ int reftable_dump_main(int argc, char *const *argv)
7756
opt_hash_id = GIT_SHA256_FORMAT_ID;
7857
else if (!strcmp("-s", argv[1]))
7958
opt_dump_stack = 1;
80-
else if (!strcmp("-c", argv[1]))
81-
opt_compact = 1;
8259
else if (!strcmp("-?", argv[1]) || !strcmp("-h", argv[1])) {
8360
print_help();
8461
return 2;
@@ -98,8 +75,6 @@ int reftable_dump_main(int argc, char *const *argv)
9875
err = reftable_reader_print_file(arg);
9976
} else if (opt_dump_stack) {
10077
err = reftable_stack_print_directory(arg, opt_hash_id);
101-
} else if (opt_compact) {
102-
err = compact_stack(arg);
10378
}
10479

10580
if (err < 0) {

0 commit comments

Comments
 (0)