summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2011-03-06 23:12:19 +0100
committerJunio C Hamano <gitster@pobox.com>2011-03-09 13:10:35 -0800
commitbf42b384058ee2b34f587426d0788353ffa9012a (patch)
tree38f313650b79719502b59759ddce12918ccf058e /submodule.c
parent1fb2550202d6f88d90121624c1fac0b81ff8c33f (diff)
downloadgit-bf42b384058ee2b34f587426d0788353ffa9012a.tar.gz
Submodules: Add 'on-demand' value for the 'fetchRecurseSubmodule' option
Now the behavior of fetch and pull can be configured to the recently added 'on-demand' mode separately for each submodule too. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c
index afb0a0e3fe..924b156950 100644
--- a/submodule.c
+++ b/submodule.c
@@ -113,7 +113,7 @@ int parse_submodule_config_option(const char *var, const char *value)
if (!config)
config = string_list_append(&config_fetch_recurse_submodules_for_name,
strbuf_detach(&submodname, NULL));
- config->util = git_config_bool(var, value) ? (void *)1 : NULL;
+ config->util = (void *)(intptr_t)parse_fetch_recurse_submodules_arg(var, value);
strbuf_release(&submodname);
} else if ((len > 7) && !strcmp(var + len - 7, ".ignore")) {
if (strcmp(value, "untracked") && strcmp(value, "dirty") &&
@@ -380,8 +380,13 @@ int fetch_populated_submodules(int num_options, const char **options,
struct string_list_item *fetch_recurse_submodules_option;
fetch_recurse_submodules_option = unsorted_string_list_lookup(&config_fetch_recurse_submodules_for_name, name);
if (fetch_recurse_submodules_option) {
- if (!fetch_recurse_submodules_option->util)
+ if ((intptr_t)fetch_recurse_submodules_option->util == RECURSE_SUBMODULES_OFF)
continue;
+ if ((intptr_t)fetch_recurse_submodules_option->util == RECURSE_SUBMODULES_ON_DEMAND) {
+ if (!unsorted_string_list_lookup(&changed_submodule_paths, ce->name))
+ continue;
+ default_argv = "on-demand";
+ }
} else {
if (config_fetch_recurse_submodules == RECURSE_SUBMODULES_OFF)
continue;