diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-28 23:05:58 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-28 23:05:58 +0200 |
commit | e394fa01d65a5e182639e226f5b46eca999cd8d7 (patch) | |
tree | b202d6e4807998e130fbfd4ac315ac868e16c104 /submodule-config.c | |
parent | Merge branch 'bw/grep-recurse-submodules' (diff) | |
parent | builtin/read-tree: add --recurse-submodules switch (diff) | |
download | git-e394fa01d65a5e182639e226f5b46eca999cd8d7.tar.xz git-e394fa01d65a5e182639e226f5b46eca999cd8d7.zip |
Merge branch 'sb/checkout-recurse-submodules'
"git checkout" is taught the "--recurse-submodules" option.
* sb/checkout-recurse-submodules:
builtin/read-tree: add --recurse-submodules switch
builtin/checkout: add --recurse-submodules switch
entry.c: create submodules when interesting
unpack-trees: check if we can perform the operation for submodules
unpack-trees: pass old oid to verify_clean_submodule
update submodules: add submodule_move_head
submodule.c: get_super_prefix_or_empty
update submodules: move up prepare_submodule_repo_env
submodules: introduce check to see whether to touch a submodule
update submodules: add a config option to determine if submodules are updated
update submodules: add submodule config parsing
make is_submodule_populated gently
lib-submodule-update.sh: define tests for recursing into submodules
lib-submodule-update.sh: replace sha1 by hash
lib-submodule-update: teach test_submodule_content the -C <dir> flag
lib-submodule-update.sh: do not use ./. as submodule remote
lib-submodule-update.sh: reorder create_lib_submodule_repo
submodule--helper.c: remove duplicate code
connect_work_tree_and_git_dir: safely create leading directories
Diffstat (limited to 'submodule-config.c')
-rw-r--r-- | submodule-config.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/submodule-config.c b/submodule-config.c index bb069bc097..4f58491ddb 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -234,6 +234,26 @@ int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg) return parse_fetch_recurse(opt, arg, 1); } +static int parse_update_recurse(const char *opt, const char *arg, + int die_on_error) +{ + switch (git_config_maybe_bool(opt, arg)) { + case 1: + return RECURSE_SUBMODULES_ON; + case 0: + return RECURSE_SUBMODULES_OFF; + default: + if (die_on_error) + die("bad %s argument: %s", opt, arg); + return RECURSE_SUBMODULES_ERROR; + } +} + +int parse_update_recurse_submodules_arg(const char *opt, const char *arg) +{ + return parse_update_recurse(opt, arg, 1); +} + static int parse_push_recurse(const char *opt, const char *arg, int die_on_error) { |