1 #include "test-tool.h"
2 #include "submodule-config.h"
3 
die_usage(const char ** argv,const char * msg)4 static void die_usage(const char **argv, const char *msg)
5 {
6 	fprintf(stderr, "%s\n", msg);
7 	fprintf(stderr, "Usage: %s <submodulepath> <config name>\n", argv[0]);
8 	exit(1);
9 }
10 
cmd__submodule_nested_repo_config(int argc,const char ** argv)11 int cmd__submodule_nested_repo_config(int argc, const char **argv)
12 {
13 	struct repository subrepo;
14 
15 	if (argc < 3)
16 		die_usage(argv, "Wrong number of arguments.");
17 
18 	setup_git_directory();
19 
20 	if (repo_submodule_init(&subrepo, the_repository, argv[1], null_oid())) {
21 		die_usage(argv, "Submodule not found.");
22 	}
23 
24 	/* Read the config of _child_ submodules. */
25 	print_config_from_gitmodules(&subrepo, argv[2]);
26 
27 	submodule_free(the_repository);
28 
29 	return 0;
30 }
31