diff options
author | Brandon Williams <bmwill@google.com> | 2017-03-18 01:38:04 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-18 19:51:23 +0300 |
commit | 1f8d711548c08e05766e067dc23e5be3b1b72657 (patch) | |
tree | a3ffbc67a915610100eaf03cd0ce669cc18d439e /builtin/submodule--helper.c | |
parent | bb62e0a99fcbb9ceb03502bf2168d2e57530214f (diff) |
submodule--helper init: set submodule.<name>.active
When initializing a submodule set the submodule.<name>.active config to
true if the module hasn't already been configured to be active by some
other means (e.g. a pathspec set in submodule.active).
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r-- | builtin/submodule--helper.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 65208faa7f..7700d89488 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -357,6 +357,18 @@ static void init_submodule(const char *path, const char *prefix, int quiet) displaypath); /* + * NEEDSWORK: In a multi-working-tree world, this needs to be + * set in the per-worktree config. + * + * Set active flag for the submodule being initialized + */ + if (!is_submodule_initialized(path)) { + strbuf_reset(&sb); + strbuf_addf(&sb, "submodule.%s.active", sub->name); + git_config_set_gently(sb.buf, "true"); + } + + /* * Copy url setting when it is not set yet. * To look up the url in .git/config, we must not fall back to * .gitmodules, so look it up directly. |