diff mbox series

[v2,3/5] test helpers: remove unused test-tool path-utils slice-tests

Message ID patch-3.5-44948c6ace9-20210421T144921Z-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series test-lib-functions.sh: trickery to make -x less verbose | expand

Commit Message

Ævar Arnfjörð Bjarmason April 21, 2021, 2:58 p.m. UTC
This utility was last used in the code removed in 4c2c38e800f (ci:
modification of main.yml to use cmake for vs-build job,
2020-06-26). Let's also remove this now-dead code.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/helper/test-path-utils.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

Comments

Ævar Arnfjörð Bjarmason April 21, 2021, 6:02 p.m. UTC | #1
On Wed, Apr 21 2021, Ævar Arnfjörð Bjarmason wrote:

> This utility was last used in the code removed in 4c2c38e800f (ci:
> modification of main.yml to use cmake for vs-build job,
> 2020-06-26). Let's also remove this now-dead code.

This patch needs to be dropped, turns out it's used outside of t/ in
ci/, didn't think to grep for test helpers there. Will hold off on a
re-roll for a bit pending further feedback.

Junio, unless you'd like to have it sooner than later?
diff mbox series

Patch

diff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c
index 313a153209c..3d7c0f1d19d 100644
--- a/t/helper/test-path-utils.c
+++ b/t/helper/test-path-utils.c
@@ -177,14 +177,6 @@  static int is_dotgitmodules(const char *path)
 	return is_hfs_dotgitmodules(path) || is_ntfs_dotgitmodules(path);
 }
 
-static int cmp_by_st_size(const void *a, const void *b)
-{
-	intptr_t x = (intptr_t)((struct string_list_item *)a)->util;
-	intptr_t y = (intptr_t)((struct string_list_item *)b)->util;
-
-	return x > y ? -1 : (x < y ? +1 : 0);
-}
-
 /*
  * A very simple, reproducible pseudo-random generator. Copied from
  * `test-genrandom.c`.
@@ -428,29 +420,6 @@  int cmd__path_utils(int argc, const char **argv)
 		return 0;
 	}
 
-	if (argc > 5 && !strcmp(argv[1], "slice-tests")) {
-		int res = 0;
-		long offset, stride, i;
-		struct string_list list = STRING_LIST_INIT_NODUP;
-		struct stat st;
-
-		offset = strtol(argv[2], NULL, 10);
-		stride = strtol(argv[3], NULL, 10);
-		if (stride < 1)
-			stride = 1;
-		for (i = 4; i < argc; i++)
-			if (stat(argv[i], &st))
-				res = error_errno("Cannot stat '%s'", argv[i]);
-			else
-				string_list_append(&list, argv[i])->util =
-					(void *)(intptr_t)st.st_size;
-		QSORT(list.items, list.nr, cmp_by_st_size);
-		for (i = offset; i < list.nr; i+= stride)
-			printf("%s\n", list.items[i].string);
-
-		return !!res;
-	}
-
 	if (argc > 1 && !strcmp(argv[1], "protect_ntfs_hfs"))
 		return !!protect_ntfs_hfs_benchmark(argc - 1, argv + 1);