diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-07-13 16:14:54 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-13 16:14:54 -0700 |
commit | c9c63ee558ce3399bd2016388da9676d4f5ecf55 (patch) | |
tree | 6a799522833b916186424ff760e99818f3fe722c /submodule-config.c | |
parent | 91f69225443b3be8d3f11c5c71795169d7d00737 (diff) | |
parent | e8906a9019799c0761ab5447b67582ffd9bae558 (diff) | |
download | git-c9c63ee558ce3399bd2016388da9676d4f5ecf55.tar.gz |
Merge branch 'sb/pull-rebase-submodule'
"git pull --rebase --recurse-submodules" learns to rebase the
branch in the submodules to an updated base.
* sb/pull-rebase-submodule:
builtin/fetch cleanup: always set default value for submodule recursing
pull: optionally rebase submodules (remote submodule changes only)
builtin/fetch: parse recurse-submodules-default at default options parsing
builtin/fetch: factor submodule recurse parsing out to submodule config
Diffstat (limited to 'submodule-config.c')
-rw-r--r-- | submodule-config.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/submodule-config.c b/submodule-config.c index eeb154a894..5fe2d07877 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -4,6 +4,7 @@ #include "submodule-config.h" #include "submodule.h" #include "strbuf.h" +#include "parse-options.h" /* * submodule cache lookup structure @@ -252,6 +253,27 @@ int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg) return parse_fetch_recurse(opt, arg, 1); } +int option_fetch_parse_recurse_submodules(const struct option *opt, + const char *arg, int unset) +{ + int *v; + + if (!opt->value) + return -1; + + v = opt->value; + + if (unset) { + *v = RECURSE_SUBMODULES_OFF; + } else { + if (arg) + *v = parse_fetch_recurse_submodules_arg(opt->long_name, arg); + else + *v = RECURSE_SUBMODULES_ON; + } + return 0; +} + static int parse_update_recurse(const char *opt, const char *arg, int die_on_error) { |