repository: repo_submodule_init to take a submodule struct
[gitweb.git] / t / helper / test-submodule-nested-repo-config.c
index a31e2a9bea60a8699cbe4b335a84113cc531f7ed..bc97929bbc3a9f03c069ea556575de4ef4397d23 100644 (file)
@@ -10,19 +10,21 @@ static void die_usage(int argc, const char **argv, const char *msg)
 
 int cmd__submodule_nested_repo_config(int argc, const char **argv)
 {
-       struct repository submodule;
+       struct repository subrepo;
+       const struct submodule *sub;
 
        if (argc < 3)
                die_usage(argc, argv, "Wrong number of arguments.");
 
        setup_git_directory();
 
-       if (repo_submodule_init(&submodule, the_repository, argv[1])) {
+       sub = submodule_from_path(the_repository, &null_oid, argv[1]);
+       if (repo_submodule_init(&subrepo, the_repository, sub)) {
                die_usage(argc, argv, "Submodule not found.");
        }
 
        /* Read the config of _child_ submodules. */
-       print_config_from_gitmodules(&submodule, argv[2]);
+       print_config_from_gitmodules(&subrepo, argv[2]);
 
        submodule_free(the_repository);