]> git.ipfire.org Git - thirdparty/git.git/blobdiff - submodule.c
Merge branch 'ss/submodule-summary-in-c'
[thirdparty/git.git] / submodule.c
index 8273647b73988ebd85d5134cb59daea884c18703..6f8002fc9e2e33d650a5a3792b1faf48b4a969bf 100644 (file)
@@ -194,7 +194,7 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
                char *key;
 
                key = xstrfmt("submodule.%s.ignore", submodule->name);
-               if (repo_config_get_string_const(the_repository, key, &ignore))
+               if (repo_config_get_string_tmp(the_repository, key, &ignore))
                        ignore = submodule->ignore;
                free(key);
 
@@ -1299,7 +1299,7 @@ static int get_fetch_recurse_config(const struct submodule *submodule,
 
                int fetch_recurse = submodule->fetch_recurse;
                key = xstrfmt("submodule.%s.fetchRecurseSubmodules", submodule->name);
-               if (!repo_config_get_string_const(spf->r, key, &value)) {
+               if (!repo_config_get_string_tmp(spf->r, key, &value)) {
                        fetch_recurse = parse_fetch_recurse_submodules_arg(key, value);
                }
                free(key);
@@ -1726,14 +1726,6 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
 int submodule_uses_gitfile(const char *path)
 {
        struct child_process cp = CHILD_PROCESS_INIT;
-       const char *argv[] = {
-               "submodule",
-               "foreach",
-               "--quiet",
-               "--recursive",
-               "test -f .git",
-               NULL,
-       };
        struct strbuf buf = STRBUF_INIT;
        const char *git_dir;
 
@@ -1746,7 +1738,10 @@ int submodule_uses_gitfile(const char *path)
        strbuf_release(&buf);
 
        /* Now test that all nested submodules use a gitfile too */
-       cp.argv = argv;
+       strvec_pushl(&cp.args,
+                    "submodule", "foreach", "--quiet", "--recursive",
+                    "test -f .git", NULL);
+
        prepare_submodule_repo_env(&cp.env_array);
        cp.git_cmd = 1;
        cp.no_stdin = 1;