Re: [PATCH 12/15] unpack-trees: check if we can perform the operation for submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/15, Stefan Beller wrote:
> +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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]