summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2011-03-06 23:11:21 +0100
committerJunio C Hamano <gitster@pobox.com>2011-03-09 13:10:35 -0800
commit8f0700dd33f63e594b9b34c84efe94e670ea4f45 (patch)
tree3d1640ca9db94519f5a9355664b56a5d773b0d47 /submodule.c
parent88a21979c5717e3f37b9691e90b6dbf2b94c751a (diff)
downloadgit-8f0700dd33f63e594b9b34c84efe94e670ea4f45.tar.gz
fetch/pull: Add the 'on-demand' value to the --recurse-submodules option
Until now the --recurse-submodules option could only be used to either fetch all populated submodules recursively or to disable recursion completely. As fetch and pull now by default just fetch those submodules for which new commits have been fetched in the superproject, a command line option to enforce that behavior is needed to be able to override configuration settings. 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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c
index e2486952bc..8d9f1db943 100644
--- a/submodule.c
+++ b/submodule.c
@@ -330,7 +330,7 @@ void check_for_new_submodule_commits(unsigned char new_sha1[20])
}
int fetch_populated_submodules(int num_options, const char **options,
- const char *prefix, int ignore_config,
+ const char *prefix, int command_line_option,
int quiet)
{
int i, result = 0, argc = 0, default_argc;
@@ -376,7 +376,7 @@ int fetch_populated_submodules(int num_options, const char **options,
name = name_for_path->util;
default_argv = "yes";
- if (!ignore_config) {
+ if (command_line_option == RECURSE_SUBMODULES_DEFAULT) {
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) {
@@ -391,6 +391,10 @@ int fetch_populated_submodules(int num_options, const char **options,
default_argv = "on-demand";
}
}
+ } else if (command_line_option == RECURSE_SUBMODULES_ON_DEMAND) {
+ if (!unsorted_string_list_lookup(&changed_submodule_paths, ce->name))
+ continue;
+ default_argv = "on-demand";
}
strbuf_addf(&submodule_path, "%s/%s", work_tree, ce->name);