diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-10 11:46:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-10 11:46:29 -0700 |
commit | 6d09fc54f60cfd8d91f471c3bcdc935c8e301458 (patch) | |
tree | 513b94beae2d7bc6f6a125ca932bf69262d9daa5 /builtin | |
parent | Merge branch 'ab/mailmap-leakfix' (diff) | |
parent | clone: set submodule.recurse=true if submodule.stickyRecursiveClone enabled (diff) | |
download | tgif-6d09fc54f60cfd8d91f471c3bcdc935c8e301458.tar.xz |
Merge branch 'mk/clone-recurse-submodules'
After "git clone --recurse-submodules", all submodules are cloned
but they are not by default recursed into by other commands. With
submodule.stickyRecursiveClone configuration set, submodule.recurse
configuration is set to true in a repository created by "clone"
with "--recurse-submodules" option.
* mk/clone-recurse-submodules:
clone: set submodule.recurse=true if submodule.stickyRecursiveClone enabled
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clone.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 66fe66679c..9c0c68a8ef 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -1114,6 +1114,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) if (option_recurse_submodules.nr > 0) { struct string_list_item *item; struct strbuf sb = STRBUF_INIT; + int val; /* remove duplicates */ string_list_sort(&option_recurse_submodules); @@ -1130,6 +1131,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix) strbuf_detach(&sb, NULL)); } + if (!git_config_get_bool("submodule.stickyRecursiveClone", &val) && + val) + string_list_append(&option_config, "submodule.recurse=true"); + if (option_required_reference.nr && option_optional_reference.nr) die(_("clone --recursive is not compatible with " |