Merge branch 'mh/for-each-string-list-item-empty-fix'
[gitweb.git] / t / helper / test-submodule-config.c
index c6c57bba0d397e44e8897b05d479a30b53311517..f23db3b19a9911b554ca8eaf567cd0370d42af6e 100644 (file)
@@ -10,11 +10,6 @@ static void die_usage(int argc, const char **argv, const char *msg)
        exit(1);
 }
 
-static int git_test_config(const char *var, const char *value, void *cb)
-{
-       return parse_submodule_config_option(var, value);
-}
-
 int cmd_main(int argc, const char **argv)
 {
        const char **arg = argv;
@@ -37,11 +32,9 @@ int cmd_main(int argc, const char **argv)
                die_usage(argc, argv, "Wrong number of arguments.");
 
        setup_git_directory();
-       gitmodules_config();
-       git_config(git_test_config, NULL);
 
        while (*arg) {
-               unsigned char commit_sha1[20];
+               struct object_id commit_oid;
                const struct submodule *submodule;
                const char *commit;
                const char *path_or_name;
@@ -50,14 +43,14 @@ int cmd_main(int argc, const char **argv)
                path_or_name = arg[1];
 
                if (commit[0] == '\0')
-                       hashclr(commit_sha1);
-               else if (get_sha1(commit, commit_sha1) < 0)
+                       oidclr(&commit_oid);
+               else if (get_oid(commit, &commit_oid) < 0)
                        die_usage(argc, argv, "Commit not found.");
 
                if (lookup_name) {
-                       submodule = submodule_from_name(commit_sha1, path_or_name);
+                       submodule = submodule_from_name(&commit_oid, path_or_name);
                } else
-                       submodule = submodule_from_path(commit_sha1, path_or_name);
+                       submodule = submodule_from_path(&commit_oid, path_or_name);
                if (!submodule)
                        die_usage(argc, argv, "Submodule not found.");