[PATCH v2 07/15] reftable/dump: drop unused `compact_stack()`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <ps@xxxxxx>
---
 reftable/dump.c | 27 +--------------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/reftable/dump.c b/reftable/dump.c
index dd65d9e8bb..391d93de6a 100644
--- a/reftable/dump.c
+++ b/reftable/dump.c
@@ -24,30 +24,10 @@ license that can be found in the LICENSE file or at
 #include <unistd.h>
 #include <string.h>
 
-static int compact_stack(const char *stackdir)
-{
-	struct reftable_stack *stack = NULL;
-	struct reftable_write_options opts = { 0 };
-
-	int err = reftable_new_stack(&stack, stackdir, &opts);
-	if (err < 0)
-		goto done;
-
-	err = reftable_stack_compact_all(stack, NULL);
-	if (err < 0)
-		goto done;
-done:
-	if (stack) {
-		reftable_stack_destroy(stack);
-	}
-	return err;
-}
-
 static void print_help(void)
 {
-	printf("usage: dump [-cst] arg\n\n"
+	printf("usage: dump [-st] arg\n\n"
 	       "options: \n"
-	       "  -c compact\n"
 	       "  -b dump blocks\n"
 	       "  -t dump table\n"
 	       "  -s dump stack\n"
@@ -62,7 +42,6 @@ int reftable_dump_main(int argc, char *const *argv)
 	int opt_dump_blocks = 0;
 	int opt_dump_table = 0;
 	int opt_dump_stack = 0;
-	int opt_compact = 0;
 	uint32_t opt_hash_id = GIT_SHA1_FORMAT_ID;
 	const char *arg = NULL, *argv0 = argv[0];
 
@@ -77,8 +56,6 @@ int reftable_dump_main(int argc, char *const *argv)
 			opt_hash_id = GIT_SHA256_FORMAT_ID;
 		else if (!strcmp("-s", argv[1]))
 			opt_dump_stack = 1;
-		else if (!strcmp("-c", argv[1]))
-			opt_compact = 1;
 		else if (!strcmp("-?", argv[1]) || !strcmp("-h", argv[1])) {
 			print_help();
 			return 2;
@@ -98,8 +75,6 @@ int reftable_dump_main(int argc, char *const *argv)
 		err = reftable_reader_print_file(arg);
 	} else if (opt_dump_stack) {
 		err = reftable_stack_print_directory(arg, opt_hash_id);
-	} else if (opt_compact) {
-		err = compact_stack(arg);
 	}
 
 	if (err < 0) {
-- 
2.46.0.46.g406f326d27.dirty





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux