submodule--helper: move "is-active" to a test-tool

Create a new "test-tool submodule" and move the "is-active" subcommand
over to it. It was added in 5c2bd8b77a (submodule--helper: add
is-active subcommand, 2017-03-16), since
a452128a36 (submodule--helper: introduce add-config subcommand,
2021-08-06) it hasn't been used by git-submodule.sh.

Since we're creating a command dispatch similar to test-tool.c itself
let's split out the "struct test_cmd" into a new test-tool-utils.h,
which both this new code and test-tool.c itself can use.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2022-09-01 01:17:48 +02:00
committed by Junio C Hamano
parent 255a1ae5da
commit 9fb2a970e9
7 changed files with 90 additions and 30 deletions

View File

@ -0,0 +1,9 @@
#ifndef TEST_TOOL_UTILS_H
#define TEST_TOOL_UTILS_H
struct test_cmd {
const char *name;
int (*fn)(int argc, const char **argv);
};
#endif