From d7992421e1a0e3ea5f836d8906e0f8b197fb6c1e Mon Sep 17 00:00:00 2001 From: Matheus Tavares Date: Wed, 15 Jan 2020 23:39:55 -0300 Subject: submodule-config: add skip_if_read option to repo_read_gitmodules() Currently, submodule-config.c doesn't have an externally accessible function to read gitmodules only if it wasn't already read. But this exact behavior is internally implemented by gitmodules_read_check(), to perform a lazy load. Let's merge this function with repo_read_gitmodules() adding a 'skip_if_read' which allows both internal and external callers to access this functionality. This simplifies a little the code. The added option will also be used in the following patch. Signed-off-by: Matheus Tavares Signed-off-by: Junio C Hamano --- submodule-config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'submodule-config.h') diff --git a/submodule-config.h b/submodule-config.h index 42918b55e8..c11e22cf50 100644 --- a/submodule-config.h +++ b/submodule-config.h @@ -61,7 +61,7 @@ int option_fetch_parse_recurse_submodules(const struct option *opt, const char *arg, int unset); int parse_update_recurse_submodules_arg(const char *opt, const char *arg); int parse_push_recurse_submodules_arg(const char *opt, const char *arg); -void repo_read_gitmodules(struct repository *repo); +void repo_read_gitmodules(struct repository *repo, int skip_if_read); void gitmodules_config_oid(const struct object_id *commit_oid); /** -- cgit v1.2.3