treewide: remove cache.h inclusion due to setup.h changes
[alt-git.git] / t / helper / test-submodule-nested-repo-config.c
blobd31f5e48ab58ee99ca44e27d9f3249aba68ef879
1 #include "test-tool.h"
2 #include "setup.h"
3 #include "submodule-config.h"
5 static void die_usage(const char **argv, const char *msg)
7 fprintf(stderr, "%s\n", msg);
8 fprintf(stderr, "Usage: %s <submodulepath> <config name>\n", argv[0]);
9 exit(1);
12 int cmd__submodule_nested_repo_config(int argc, const char **argv)
14 struct repository subrepo;
16 if (argc < 3)
17 die_usage(argv, "Wrong number of arguments.");
19 setup_git_directory();
21 if (repo_submodule_init(&subrepo, the_repository, argv[1], null_oid())) {
22 die_usage(argv, "Submodule not found.");
25 /* Read the config of _child_ submodules. */
26 print_config_from_gitmodules(&subrepo, argv[2]);
28 submodule_free(the_repository);
30 return 0;