Re: [PATCH 12/15] unpack-trees: check if we can perform the operation for submodules
- From
- Brandon Williams <bmwill@google.com>
- Date
- Feb 16, 2017, 18:01 UTC
- Message-ID
- <20170216180113.GA158636@google.com>
- In-Reply-To
- <20170216003811.18273-13-sbeller@google.com>
On 02/15, Stefan Beller wrote:
Show 20 quoted lines
> +static void reload_gitmodules_file(struct index_state *index,
> + struct checkout *state)
> +{
> + int i;
> + for (i = 0; i < index->cache_nr; i++) {
> + struct cache_entry *ce = index->cache[i];
> + if (ce->ce_flags & CE_UPDATE) {
> +
> + int r = strcmp(ce->name, ".gitmodules");
> + if (r < 0)
> + continue;
> + else if (r == 0) {
> + checkout_entry(ce, state, NULL);
> + } else
> + break;
> + }
> + }
> + gitmodules_config();
> + git_config(submodule_config, NULL);
> +}If we are reloading the gitmodules file do you think it would makes sense to add in a call to 'submodule_free()' to clear the cache used to store the gitmodules config?
-- Brandon Williams