From b22e51cb26bc93bd1548950e61970a9973e04b70 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 2 Aug 2017 12:49:17 -0700 Subject: config: add config_from_gitmodules Add 'config_from_gitmodules()' function which can be used by 'fetch' and 'update_clone' in order to maintain backwards compatibility with configuration being stored in .gitmodules' since a future patch will remove reading these values in the submodule-config. This function should not be used anywhere other than in 'fetch' and 'update_clone'. Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- config.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'config.h') diff --git a/config.h b/config.h index 0352da117..6998e6645 100644 --- a/config.h +++ b/config.h @@ -187,6 +187,16 @@ extern int repo_config_get_maybe_bool(struct repository *repo, extern int repo_config_get_pathname(struct repository *repo, const char *key, const char **dest); +/* + * Note: This function exists solely to maintain backward compatibility with + * 'fetch' and 'update_clone' storing configuration in '.gitmodules' and should + * NOT be used anywhere else. + * + * Runs the provided config function on the '.gitmodules' file found in the + * working directory. + */ +extern void config_from_gitmodules(config_fn_t fn, void *data); + extern int git_config_get_value(const char *key, const char **value); extern const struct string_list *git_config_get_value_multi(const char *key); extern void git_config_clear(void); -- cgit v1.2.1