diff options
author | Stefan Beller <sbeller@google.com> | 2017-05-26 12:10:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-30 14:28:53 +0900 |
commit | d7a3803f9e83242adac0f02af843ef0520c71f0a (patch) | |
tree | 8bf2a8812f7529fdb56606719db8e674fdf47d09 /submodule.h | |
parent | 17f38cb704623561fb4efd143429d63149f585d8 (diff) | |
download | git-d7a3803f9e83242adac0f02af843ef0520c71f0a.tar.gz |
reset/checkout/read-tree: unify config callback for submodule recursion
The callback function is essentially duplicated 3 times. Remove all
of them and offer a new callback function, that lives in submodule.c
By putting the callback function there, we no longer need the function
'set_config_update_recurse_submodules', nor duplicate the global variable
in each builtin as well as submodule.c
In the three builtins we have different 2 ways how to load the .gitmodules
and config file, which are slightly different. git-checkout has to load
the submodule config all the time due to 23b4c7bcc5 (checkout: Use
submodule.*.ignore settings from .git/config and .gitmodules, 2010-08-28)
git-reset and git-read-tree do not respect these diff settings, so loading
the submodule configuration is optional. Also put that into submodule.c
for code deduplication.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
-rw-r--r-- | submodule.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/submodule.h b/submodule.h index 1277480add..b13f120f76 100644 --- a/submodule.h +++ b/submodule.h @@ -39,6 +39,11 @@ extern void stage_updated_gitmodules(void); extern void set_diffopt_flags_from_submodule_config(struct diff_options *, const char *path); extern int submodule_config(const char *var, const char *value, void *cb); + +struct option; +int option_parse_recurse_submodules_worktree_updater(const struct option *opt, + const char *arg, int unset); +void load_submodule_cache(void); extern void gitmodules_config(void); extern void gitmodules_config_sha1(const unsigned char *commit_sha1); extern int is_submodule_initialized(const char *path); @@ -65,7 +70,6 @@ extern void show_submodule_inline_diff(FILE *f, const char *path, const char *del, const char *add, const char *reset, const struct diff_options *opt); extern void set_config_fetch_recurse_submodules(int value); -extern void set_config_update_recurse_submodules(int value); /* Check if we want to update any submodule.*/ extern int should_update_submodules(void); /* |