diff options
author | Matheus Tavares <matheus.bernardino@usp.br> | 2020-01-16 05:39:55 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-18 00:52:14 +0300 |
commit | d7992421e1a0e3ea5f836d8906e0f8b197fb6c1e (patch) | |
tree | 5c6e3e4f5fa6c4dcedfc23f0537824585e17bc0d /unpack-trees.c | |
parent | 1d1729caebd41b340dd8dd61057f613da4df526c (diff) |
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 <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 2399b6818b..f5a8051803 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -291,11 +291,11 @@ static void load_gitmodules_file(struct index_state *index, if (pos >= 0) { struct cache_entry *ce = index->cache[pos]; if (!state && ce->ce_flags & CE_WT_REMOVE) { - repo_read_gitmodules(the_repository); + repo_read_gitmodules(the_repository, 0); } else if (state && (ce->ce_flags & CE_UPDATE)) { submodule_free(the_repository); checkout_entry(ce, state, NULL, NULL); - repo_read_gitmodules(the_repository); + repo_read_gitmodules(the_repository, 0); } } } |