submodule: remove fetch.recursesubmodules from submodule-config parsing
[git/git.git] / builtin / fetch.c
index ade092b..d84c263 100644 (file)
@@ -71,6 +71,9 @@ static int git_fetch_config(const char *k, const char *v, void *cb)
        if (!strcmp(k, "submodule.fetchjobs")) {
                max_children = parse_submodule_fetchjobs(k, v);
                return 0;
+       } else if (!strcmp(k, "fetch.recursesubmodules")) {
+               recurse_submodules = parse_fetch_recurse_submodules_arg(k, v);
+               return 0;
        }
 
        return git_default_config(k, v, cb);
@@ -81,6 +84,9 @@ static int gitmodules_fetch_config(const char *var, const char *value, void *cb)
        if (!strcmp(var, "submodule.fetchjobs")) {
                max_children = parse_submodule_fetchjobs(var, value);
                return 0;
+       } else if (!strcmp(var, "fetch.recursesubmodules")) {
+               recurse_submodules = parse_fetch_recurse_submodules_arg(var, value);
+               return 0;
        }
 
        return 0;
@@ -1355,7 +1361,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
                deepen = 1;
 
        if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
-               set_config_fetch_recurse_submodules(recurse_submodules_default);
                gitmodules_config();
                git_config(submodule_config, NULL);
        }
@@ -1399,6 +1404,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
                result = fetch_populated_submodules(&options,
                                                    submodule_prefix,
                                                    recurse_submodules,
+                                                   recurse_submodules_default,
                                                    verbosity < 0,
                                                    max_children);
                argv_array_clear(&options);